From c16cab91b408d4aaf058bdf1c457fb2a6a23caa2 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Mon, 15 Jul 2024 02:18:46 +0100 Subject: [PATCH] Demos: Move /test/integration to /demos --- .editorconfig | 6 +++--- .eslintrc.json | 8 ++++---- .github/workflows/CI.yaml | 4 ++-- .gitignore | 4 ++-- CONTRIBUTING.md | 6 ++---- {test/integration => demos}/grunt-contrib-qunit.js | 0 .../grunt-contrib-qunit/Gruntfile.js | 0 {test/integration => demos}/grunt-contrib-qunit/README.md | 0 .../grunt-contrib-qunit/fail-assert.html | 0 .../grunt-contrib-qunit/fail-no-tests.html | 0 .../grunt-contrib-qunit/fail-uncaught.html | 0 .../grunt-contrib-qunit/package.json | 0 .../grunt-contrib-qunit/pass-basic.html | 0 demos/grunt-contrib-qunit/qunit | 1 + {test/integration => demos}/karma-qunit.js | 0 {test/integration => demos}/karma-qunit/README.md | 0 {test/integration => demos}/karma-qunit/fail-assert.js | 0 .../karma-qunit/fail-global-error.js | 0 {test/integration => demos}/karma-qunit/karma.conf.js | 0 {test/integration => demos}/karma-qunit/package.json | 2 +- {test/integration => demos}/karma-qunit/pass-basic.js | 0 {test/integration => demos}/karma-qunit/pass-config.js | 0 {test/integration => demos}/nyc.js | 0 {test/integration => demos}/nyc/.gitignore | 0 {test/integration => demos}/nyc/README.md | 0 {test/integration => demos}/nyc/index.js | 0 {test/integration => demos}/nyc/package.json | 2 +- {test/integration => demos}/nyc/src/add.js | 0 {test/integration => demos}/nyc/src/subtract.js | 0 {test/integration => demos}/nyc/test/add.js | 0 {test/integration => demos}/testem.js | 0 {test/integration => demos}/testem/README.md | 0 {test/integration => demos}/testem/add.js | 0 {test/integration => demos}/testem/add.test.js | 0 {test/integration => demos}/testem/package.json | 0 demos/testem/qunit | 1 + {test/integration => demos}/testem/test.html | 0 {test/integration => demos}/testem/testem.json | 0 docs/cli.md | 2 +- package.json | 2 +- test/cli/structure.js | 3 +-- test/integration/grunt-contrib-qunit/qunit | 1 - test/integration/testem/qunit | 1 - 43 files changed, 20 insertions(+), 23 deletions(-) rename {test/integration => demos}/grunt-contrib-qunit.js (100%) rename {test/integration => demos}/grunt-contrib-qunit/Gruntfile.js (100%) rename {test/integration => demos}/grunt-contrib-qunit/README.md (100%) rename {test/integration => demos}/grunt-contrib-qunit/fail-assert.html (100%) rename {test/integration => demos}/grunt-contrib-qunit/fail-no-tests.html (100%) rename {test/integration => demos}/grunt-contrib-qunit/fail-uncaught.html (100%) rename {test/integration => demos}/grunt-contrib-qunit/package.json (100%) rename {test/integration => demos}/grunt-contrib-qunit/pass-basic.html (100%) create mode 120000 demos/grunt-contrib-qunit/qunit rename {test/integration => demos}/karma-qunit.js (100%) rename {test/integration => demos}/karma-qunit/README.md (100%) rename {test/integration => demos}/karma-qunit/fail-assert.js (100%) rename {test/integration => demos}/karma-qunit/fail-global-error.js (100%) rename {test/integration => demos}/karma-qunit/karma.conf.js (100%) rename {test/integration => demos}/karma-qunit/package.json (89%) rename {test/integration => demos}/karma-qunit/pass-basic.js (100%) rename {test/integration => demos}/karma-qunit/pass-config.js (100%) rename {test/integration => demos}/nyc.js (100%) rename {test/integration => demos}/nyc/.gitignore (100%) rename {test/integration => demos}/nyc/README.md (100%) rename {test/integration => demos}/nyc/index.js (100%) rename {test/integration => demos}/nyc/package.json (90%) rename {test/integration => demos}/nyc/src/add.js (100%) rename {test/integration => demos}/nyc/src/subtract.js (100%) rename {test/integration => demos}/nyc/test/add.js (100%) rename {test/integration => demos}/testem.js (100%) rename {test/integration => demos}/testem/README.md (100%) rename {test/integration => demos}/testem/add.js (100%) rename {test/integration => demos}/testem/add.test.js (100%) rename {test/integration => demos}/testem/package.json (100%) create mode 120000 demos/testem/qunit rename {test/integration => demos}/testem/test.html (100%) rename {test/integration => demos}/testem/testem.json (100%) delete mode 120000 test/integration/grunt-contrib-qunit/qunit delete mode 120000 test/integration/testem/qunit diff --git a/.editorconfig b/.editorconfig index de9edd721..600258dfe 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,11 +10,11 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -[test/cli/TapReporter.js] +[demos/grunt-contrib-qunit.js] trim_trailing_whitespace = false -[test/integration/grunt-contrib-qunit.js] +[demos/nyc.js] trim_trailing_whitespace = false -[test/integration/nyc.js] +[test/cli/TapReporter.js] trim_trailing_whitespace = false [*.css] diff --git a/.eslintrc.json b/.eslintrc.json index fdfc36087..0b725fe7d 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -12,14 +12,14 @@ "ignorePatterns": [ "__codeorigin/**", "coverage/**", + "demos/*/qunit/**", + "demos/*/coverage/**", + "demos/*/package-lock.json", "docs/.jekyll-cache/**", "docs/_site/**", "lib/**", "qunit/**", "test/cli/fixtures/sourcemap/*.min.js", - "test/integration/*/qunit/**", - "test/integration/*/coverage/**", - "test/integration/*/package-lock.json", "temp/**" ], "overrides": [ @@ -190,7 +190,7 @@ } }, { - "files": ["test/integration/**/*.js"], + "files": ["demos/**/*.js"], "env": { "browser": true, "es2017": true, diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 3c4642546..a6b96bb84 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -28,10 +28,10 @@ jobs: node: 22.x script: npm run test - - name: "Integration" + - name: "Demos" os: ubuntu-20.04 node: 18.x - script: npm run test-integration + script: npm run test-demos - name: "Windows: Node 18" os: windows-latest diff --git a/.gitignore b/.gitignore index 82942b8be..c5c2d9ded 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,13 @@ /.nyc_output/ /__codeorigin/ /coverage/ +/demos/*/package-lock.json +/demos/*/node_modules/ /docs/.jekyll-cache/ /docs/_site/ /docs/Gemfile.lock /test/benchmark/package-lock.json /test/benchmark/node_modules/ -/test/integration/*/package-lock.json -/test/integration/*/node_modules/ /node_modules/ /qunit/ /temp/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 802f679ec..47113c211 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -72,15 +72,13 @@ Fixes #1. The subject line should use the [imperative mood](https://en.wikipedia.org/wiki/Imperative_mood), and start with one of the following components: -* `All` * `Assert` * `Build` * `CLI` * `Core` +* `Demos` * `Docs` -* `Dump` * `HTML Reporter` -* `Release` -* `Tests` +* `Test` See also [Commit message guidelines](https://www.mediawiki.org/wiki/Gerrit/Commit_message_guidelines). diff --git a/test/integration/grunt-contrib-qunit.js b/demos/grunt-contrib-qunit.js similarity index 100% rename from test/integration/grunt-contrib-qunit.js rename to demos/grunt-contrib-qunit.js diff --git a/test/integration/grunt-contrib-qunit/Gruntfile.js b/demos/grunt-contrib-qunit/Gruntfile.js similarity index 100% rename from test/integration/grunt-contrib-qunit/Gruntfile.js rename to demos/grunt-contrib-qunit/Gruntfile.js diff --git a/test/integration/grunt-contrib-qunit/README.md b/demos/grunt-contrib-qunit/README.md similarity index 100% rename from test/integration/grunt-contrib-qunit/README.md rename to demos/grunt-contrib-qunit/README.md diff --git a/test/integration/grunt-contrib-qunit/fail-assert.html b/demos/grunt-contrib-qunit/fail-assert.html similarity index 100% rename from test/integration/grunt-contrib-qunit/fail-assert.html rename to demos/grunt-contrib-qunit/fail-assert.html diff --git a/test/integration/grunt-contrib-qunit/fail-no-tests.html b/demos/grunt-contrib-qunit/fail-no-tests.html similarity index 100% rename from test/integration/grunt-contrib-qunit/fail-no-tests.html rename to demos/grunt-contrib-qunit/fail-no-tests.html diff --git a/test/integration/grunt-contrib-qunit/fail-uncaught.html b/demos/grunt-contrib-qunit/fail-uncaught.html similarity index 100% rename from test/integration/grunt-contrib-qunit/fail-uncaught.html rename to demos/grunt-contrib-qunit/fail-uncaught.html diff --git a/test/integration/grunt-contrib-qunit/package.json b/demos/grunt-contrib-qunit/package.json similarity index 100% rename from test/integration/grunt-contrib-qunit/package.json rename to demos/grunt-contrib-qunit/package.json diff --git a/test/integration/grunt-contrib-qunit/pass-basic.html b/demos/grunt-contrib-qunit/pass-basic.html similarity index 100% rename from test/integration/grunt-contrib-qunit/pass-basic.html rename to demos/grunt-contrib-qunit/pass-basic.html diff --git a/demos/grunt-contrib-qunit/qunit b/demos/grunt-contrib-qunit/qunit new file mode 120000 index 000000000..9f1fec0d0 --- /dev/null +++ b/demos/grunt-contrib-qunit/qunit @@ -0,0 +1 @@ +../../qunit \ No newline at end of file diff --git a/test/integration/karma-qunit.js b/demos/karma-qunit.js similarity index 100% rename from test/integration/karma-qunit.js rename to demos/karma-qunit.js diff --git a/test/integration/karma-qunit/README.md b/demos/karma-qunit/README.md similarity index 100% rename from test/integration/karma-qunit/README.md rename to demos/karma-qunit/README.md diff --git a/test/integration/karma-qunit/fail-assert.js b/demos/karma-qunit/fail-assert.js similarity index 100% rename from test/integration/karma-qunit/fail-assert.js rename to demos/karma-qunit/fail-assert.js diff --git a/test/integration/karma-qunit/fail-global-error.js b/demos/karma-qunit/fail-global-error.js similarity index 100% rename from test/integration/karma-qunit/fail-global-error.js rename to demos/karma-qunit/fail-global-error.js diff --git a/test/integration/karma-qunit/karma.conf.js b/demos/karma-qunit/karma.conf.js similarity index 100% rename from test/integration/karma-qunit/karma.conf.js rename to demos/karma-qunit/karma.conf.js diff --git a/test/integration/karma-qunit/package.json b/demos/karma-qunit/package.json similarity index 89% rename from test/integration/karma-qunit/package.json rename to demos/karma-qunit/package.json index 2783df9dc..715d0c55b 100644 --- a/test/integration/karma-qunit/package.json +++ b/demos/karma-qunit/package.json @@ -5,7 +5,7 @@ "karma-chrome-launcher": "^3.2.0", "karma-firefox-launcher": "2.1.3", "karma-qunit": "^4.2.0", - "qunit": "file:../../.." + "qunit": "file:../.." }, "scripts": { "test": "karma start --no-colors" diff --git a/test/integration/karma-qunit/pass-basic.js b/demos/karma-qunit/pass-basic.js similarity index 100% rename from test/integration/karma-qunit/pass-basic.js rename to demos/karma-qunit/pass-basic.js diff --git a/test/integration/karma-qunit/pass-config.js b/demos/karma-qunit/pass-config.js similarity index 100% rename from test/integration/karma-qunit/pass-config.js rename to demos/karma-qunit/pass-config.js diff --git a/test/integration/nyc.js b/demos/nyc.js similarity index 100% rename from test/integration/nyc.js rename to demos/nyc.js diff --git a/test/integration/nyc/.gitignore b/demos/nyc/.gitignore similarity index 100% rename from test/integration/nyc/.gitignore rename to demos/nyc/.gitignore diff --git a/test/integration/nyc/README.md b/demos/nyc/README.md similarity index 100% rename from test/integration/nyc/README.md rename to demos/nyc/README.md diff --git a/test/integration/nyc/index.js b/demos/nyc/index.js similarity index 100% rename from test/integration/nyc/index.js rename to demos/nyc/index.js diff --git a/test/integration/nyc/package.json b/demos/nyc/package.json similarity index 90% rename from test/integration/nyc/package.json rename to demos/nyc/package.json index 009475782..9e2036c2e 100644 --- a/test/integration/nyc/package.json +++ b/demos/nyc/package.json @@ -2,7 +2,7 @@ "private": true, "devDependencies": { "nyc": "15.1.0", - "qunit": "file:../../.." + "qunit": "file:../.." }, "scripts": { "test": "nyc qunit" diff --git a/test/integration/nyc/src/add.js b/demos/nyc/src/add.js similarity index 100% rename from test/integration/nyc/src/add.js rename to demos/nyc/src/add.js diff --git a/test/integration/nyc/src/subtract.js b/demos/nyc/src/subtract.js similarity index 100% rename from test/integration/nyc/src/subtract.js rename to demos/nyc/src/subtract.js diff --git a/test/integration/nyc/test/add.js b/demos/nyc/test/add.js similarity index 100% rename from test/integration/nyc/test/add.js rename to demos/nyc/test/add.js diff --git a/test/integration/testem.js b/demos/testem.js similarity index 100% rename from test/integration/testem.js rename to demos/testem.js diff --git a/test/integration/testem/README.md b/demos/testem/README.md similarity index 100% rename from test/integration/testem/README.md rename to demos/testem/README.md diff --git a/test/integration/testem/add.js b/demos/testem/add.js similarity index 100% rename from test/integration/testem/add.js rename to demos/testem/add.js diff --git a/test/integration/testem/add.test.js b/demos/testem/add.test.js similarity index 100% rename from test/integration/testem/add.test.js rename to demos/testem/add.test.js diff --git a/test/integration/testem/package.json b/demos/testem/package.json similarity index 100% rename from test/integration/testem/package.json rename to demos/testem/package.json diff --git a/demos/testem/qunit b/demos/testem/qunit new file mode 120000 index 000000000..9f1fec0d0 --- /dev/null +++ b/demos/testem/qunit @@ -0,0 +1 @@ +../../qunit \ No newline at end of file diff --git a/test/integration/testem/test.html b/demos/testem/test.html similarity index 100% rename from test/integration/testem/test.html rename to demos/testem/test.html diff --git a/test/integration/testem/testem.json b/demos/testem/testem.json similarity index 100% rename from test/integration/testem/testem.json rename to demos/testem/testem.json diff --git a/docs/cli.md b/docs/cli.md index bfcc343f6..9aec79907 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -192,7 +192,7 @@ Generate code coverage reports with [nyc](https://istanbul.js.org/): } ``` -See [/test/integration/nyc/](https://github.com/qunitjs/qunit/tree/main/test/integration/nyc) in the QUnit repo for a minimal example. +See [/demos/nyc/](https://github.com/qunitjs/qunit/tree/main/demos/nyc) in the QUnit repo for a minimal example. For a more elaborate example showcasing a unified test coverage report for tests in both Node.js and a headless browser, see [Krinkle/example-node-and-browser-qunit](https://github.com/Krinkle/example-node-and-browser-qunit-ci/). diff --git a/package.json b/package.json index 681c1bf38..7b476120f 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "test-cli": "node bin/qunit.js test/main/ test/cli/*.js", "test": "npm run lint && npm run build && npm run test-main && npm run test-cli", "test-nolint": "npm run build && npm run test-main && npm run test-cli", - "test-integration": "npm run build && node bin/qunit.js test/integration/*.js", + "test-demos": "npm run build && node bin/qunit.js demos/*.js", "browserstack": "browserstack-runner -v", "authors": "(echo 'Authors ordered by first contribution\n' && git log --format='%aN <%aE>' --no-merges --reverse | awk '!seen[$0]++') | tee AUTHORS.txt", "coverage": "npm run build-coverage && npm run coverage-cli && npm run coverage-main && nyc report", diff --git a/test/cli/structure.js b/test/cli/structure.js index 8dd278e64..8fabfa6ef 100644 --- a/test/cli/structure.js +++ b/test/cli/structure.js @@ -83,8 +83,7 @@ QUnit.module('structure', () => { .map(file => file.replace(/\\/g, '/')) // Ignore file names containing "--", which are subresources (e.g. iframes). // Ignore test/benchmark, which is unrelated. - // Ignore test/integration/grunt-contrib-qunit, which we manage separately. - .filter(file => !file.includes('--') && !file.includes('benchmark') && !file.includes('integration')) + .filter(file => !file.includes('--') && !file.includes('benchmark')) .map(file => `test/${file}`); QUnit.test('files', assert => { diff --git a/test/integration/grunt-contrib-qunit/qunit b/test/integration/grunt-contrib-qunit/qunit deleted file mode 120000 index 24e236ddd..000000000 --- a/test/integration/grunt-contrib-qunit/qunit +++ /dev/null @@ -1 +0,0 @@ -../../../qunit \ No newline at end of file diff --git a/test/integration/testem/qunit b/test/integration/testem/qunit deleted file mode 120000 index 24e236ddd..000000000 --- a/test/integration/testem/qunit +++ /dev/null @@ -1 +0,0 @@ -../../../qunit \ No newline at end of file