From bcbdb73e4cbf1c5c80ebb22479bbdcfa67ab8ea4 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Tue, 2 May 2023 11:11:34 -0400 Subject: [PATCH 01/21] Move addon to subfolder --- .editorconfig => addon/.editorconfig | 0 .ember-cli => addon/.ember-cli | 0 .eslintignore => addon/.eslintignore | 0 .eslintrc.js => addon/.eslintrc.js | 0 .npmignore => addon/.npmignore | 0 .prettierignore => addon/.prettierignore | 0 .prettierrc.js => addon/.prettierrc.js | 0 .watchmanconfig => addon/.watchmanconfig | 0 CHANGELOG.md => addon/CHANGELOG.md | 0 CONTRIBUTING.md => addon/CONTRIBUTING.md | 0 LICENSE.md => addon/LICENSE.md | 0 README.md => addon/README.md | 0 RELEASE.md => addon/RELEASE.md | 0 {addon-test-support => addon/addon-test-support}/adapter.js | 0 {addon-test-support => addon/addon-test-support}/index.js | 0 .../addon-test-support}/qunit-configuration.js | 0 .../addon-test-support}/test-isolation-validation.js | 0 {addon-test-support => addon/addon-test-support}/test-loader.js | 0 addon/{ => addon}/.gitkeep | 0 {app => addon/app}/.gitkeep | 0 {config => addon/config}/ember-try.js | 0 {config => addon/config}/environment.js | 0 ember-cli-build.js => addon/ember-cli-build.js | 0 index.js => addon/index.js | 0 package.json => addon/package.json | 0 testem.js => addon/testem.js | 0 {tests => addon/tests}/acceptance/basic-test.js | 0 {tests => addon/tests}/dummy/app/app.js | 0 {tests => addon/tests}/dummy/app/components/.gitkeep | 0 {tests => addon/tests}/dummy/app/controllers/.gitkeep | 0 {tests => addon/tests}/dummy/app/helpers/.gitkeep | 0 {tests => addon/tests}/dummy/app/index.html | 0 {tests => addon/tests}/dummy/app/models/.gitkeep | 0 {tests => addon/tests}/dummy/app/resolver.js | 0 {tests => addon/tests}/dummy/app/router.js | 0 {tests => addon/tests}/dummy/app/routes/.gitkeep | 0 {tests => addon/tests}/dummy/app/styles/app.css | 0 {tests => addon/tests}/dummy/app/templates/application.hbs | 0 {tests => addon/tests}/dummy/app/templates/components/.gitkeep | 0 {tests => addon/tests}/dummy/config/ember-cli-update.json | 0 {tests => addon/tests}/dummy/config/environment.js | 0 {tests => addon/tests}/dummy/config/optional-features.json | 0 {tests => addon/tests}/dummy/config/targets.js | 0 {tests => addon/tests}/dummy/public/crossdomain.xml | 0 {tests => addon/tests}/dummy/public/robots.txt | 0 {tests => addon/tests}/helpers/destroy-app.js | 0 {tests => addon/tests}/helpers/module-for-acceptance.js | 0 {tests => addon/tests}/helpers/resolver.js | 0 {tests => addon/tests}/helpers/start-app.js | 0 {tests => addon/tests}/index.html | 0 {tests => addon/tests}/integration/.gitkeep | 0 {tests => addon/tests}/integration/setup-rendering-test-test.js | 0 {tests => addon/tests}/integration/setup-test-test.js | 0 {tests => addon/tests}/test-helper.js | 0 {tests => addon/tests}/unit/.gitkeep | 0 {tests => addon/tests}/unit/adapter-test.js | 0 {tests => addon/tests}/unit/ember-testing-test.js | 0 .../tests}/unit/setup-ember-onerror-validation-test.js | 0 {tests => addon/tests}/unit/test-isolation-validation-test.js | 0 {tests => addon/tests}/unit/unhandled-rejection-test.js | 0 {tests => addon/tests}/unit/utils/patch-assert-helper.js | 0 {types => addon/types}/index.d.ts | 0 {types => addon/types}/local-types.d.ts | 0 {types => addon/types}/tests.ts | 0 {types => addon/types}/tsconfig.json | 0 {vendor => addon/vendor}/ember-cli/test-support-suffix.js | 0 {vendor => addon/vendor}/ember-qunit/test-container-styles.css | 0 67 files changed, 0 insertions(+), 0 deletions(-) rename .editorconfig => addon/.editorconfig (100%) rename .ember-cli => addon/.ember-cli (100%) rename .eslintignore => addon/.eslintignore (100%) rename .eslintrc.js => addon/.eslintrc.js (100%) rename .npmignore => addon/.npmignore (100%) rename .prettierignore => addon/.prettierignore (100%) rename .prettierrc.js => addon/.prettierrc.js (100%) rename .watchmanconfig => addon/.watchmanconfig (100%) rename CHANGELOG.md => addon/CHANGELOG.md (100%) rename CONTRIBUTING.md => addon/CONTRIBUTING.md (100%) rename LICENSE.md => addon/LICENSE.md (100%) rename README.md => addon/README.md (100%) rename RELEASE.md => addon/RELEASE.md (100%) rename {addon-test-support => addon/addon-test-support}/adapter.js (100%) rename {addon-test-support => addon/addon-test-support}/index.js (100%) rename {addon-test-support => addon/addon-test-support}/qunit-configuration.js (100%) rename {addon-test-support => addon/addon-test-support}/test-isolation-validation.js (100%) rename {addon-test-support => addon/addon-test-support}/test-loader.js (100%) rename addon/{ => addon}/.gitkeep (100%) rename {app => addon/app}/.gitkeep (100%) rename {config => addon/config}/ember-try.js (100%) rename {config => addon/config}/environment.js (100%) rename ember-cli-build.js => addon/ember-cli-build.js (100%) rename index.js => addon/index.js (100%) rename package.json => addon/package.json (100%) rename testem.js => addon/testem.js (100%) rename {tests => addon/tests}/acceptance/basic-test.js (100%) rename {tests => addon/tests}/dummy/app/app.js (100%) rename {tests => addon/tests}/dummy/app/components/.gitkeep (100%) rename {tests => addon/tests}/dummy/app/controllers/.gitkeep (100%) rename {tests => addon/tests}/dummy/app/helpers/.gitkeep (100%) rename {tests => addon/tests}/dummy/app/index.html (100%) rename {tests => addon/tests}/dummy/app/models/.gitkeep (100%) rename {tests => addon/tests}/dummy/app/resolver.js (100%) rename {tests => addon/tests}/dummy/app/router.js (100%) rename {tests => addon/tests}/dummy/app/routes/.gitkeep (100%) rename {tests => addon/tests}/dummy/app/styles/app.css (100%) rename {tests => addon/tests}/dummy/app/templates/application.hbs (100%) rename {tests => addon/tests}/dummy/app/templates/components/.gitkeep (100%) rename {tests => addon/tests}/dummy/config/ember-cli-update.json (100%) rename {tests => addon/tests}/dummy/config/environment.js (100%) rename {tests => addon/tests}/dummy/config/optional-features.json (100%) rename {tests => addon/tests}/dummy/config/targets.js (100%) rename {tests => addon/tests}/dummy/public/crossdomain.xml (100%) rename {tests => addon/tests}/dummy/public/robots.txt (100%) rename {tests => addon/tests}/helpers/destroy-app.js (100%) rename {tests => addon/tests}/helpers/module-for-acceptance.js (100%) rename {tests => addon/tests}/helpers/resolver.js (100%) rename {tests => addon/tests}/helpers/start-app.js (100%) rename {tests => addon/tests}/index.html (100%) rename {tests => addon/tests}/integration/.gitkeep (100%) rename {tests => addon/tests}/integration/setup-rendering-test-test.js (100%) rename {tests => addon/tests}/integration/setup-test-test.js (100%) rename {tests => addon/tests}/test-helper.js (100%) rename {tests => addon/tests}/unit/.gitkeep (100%) rename {tests => addon/tests}/unit/adapter-test.js (100%) rename {tests => addon/tests}/unit/ember-testing-test.js (100%) rename {tests => addon/tests}/unit/setup-ember-onerror-validation-test.js (100%) rename {tests => addon/tests}/unit/test-isolation-validation-test.js (100%) rename {tests => addon/tests}/unit/unhandled-rejection-test.js (100%) rename {tests => addon/tests}/unit/utils/patch-assert-helper.js (100%) rename {types => addon/types}/index.d.ts (100%) rename {types => addon/types}/local-types.d.ts (100%) rename {types => addon/types}/tests.ts (100%) rename {types => addon/types}/tsconfig.json (100%) rename {vendor => addon/vendor}/ember-cli/test-support-suffix.js (100%) rename {vendor => addon/vendor}/ember-qunit/test-container-styles.css (100%) diff --git a/.editorconfig b/addon/.editorconfig similarity index 100% rename from .editorconfig rename to addon/.editorconfig diff --git a/.ember-cli b/addon/.ember-cli similarity index 100% rename from .ember-cli rename to addon/.ember-cli diff --git a/.eslintignore b/addon/.eslintignore similarity index 100% rename from .eslintignore rename to addon/.eslintignore diff --git a/.eslintrc.js b/addon/.eslintrc.js similarity index 100% rename from .eslintrc.js rename to addon/.eslintrc.js diff --git a/.npmignore b/addon/.npmignore similarity index 100% rename from .npmignore rename to addon/.npmignore diff --git a/.prettierignore b/addon/.prettierignore similarity index 100% rename from .prettierignore rename to addon/.prettierignore diff --git a/.prettierrc.js b/addon/.prettierrc.js similarity index 100% rename from .prettierrc.js rename to addon/.prettierrc.js diff --git a/.watchmanconfig b/addon/.watchmanconfig similarity index 100% rename from .watchmanconfig rename to addon/.watchmanconfig diff --git a/CHANGELOG.md b/addon/CHANGELOG.md similarity index 100% rename from CHANGELOG.md rename to addon/CHANGELOG.md diff --git a/CONTRIBUTING.md b/addon/CONTRIBUTING.md similarity index 100% rename from CONTRIBUTING.md rename to addon/CONTRIBUTING.md diff --git a/LICENSE.md b/addon/LICENSE.md similarity index 100% rename from LICENSE.md rename to addon/LICENSE.md diff --git a/README.md b/addon/README.md similarity index 100% rename from README.md rename to addon/README.md diff --git a/RELEASE.md b/addon/RELEASE.md similarity index 100% rename from RELEASE.md rename to addon/RELEASE.md diff --git a/addon-test-support/adapter.js b/addon/addon-test-support/adapter.js similarity index 100% rename from addon-test-support/adapter.js rename to addon/addon-test-support/adapter.js diff --git a/addon-test-support/index.js b/addon/addon-test-support/index.js similarity index 100% rename from addon-test-support/index.js rename to addon/addon-test-support/index.js diff --git a/addon-test-support/qunit-configuration.js b/addon/addon-test-support/qunit-configuration.js similarity index 100% rename from addon-test-support/qunit-configuration.js rename to addon/addon-test-support/qunit-configuration.js diff --git a/addon-test-support/test-isolation-validation.js b/addon/addon-test-support/test-isolation-validation.js similarity index 100% rename from addon-test-support/test-isolation-validation.js rename to addon/addon-test-support/test-isolation-validation.js diff --git a/addon-test-support/test-loader.js b/addon/addon-test-support/test-loader.js similarity index 100% rename from addon-test-support/test-loader.js rename to addon/addon-test-support/test-loader.js diff --git a/addon/.gitkeep b/addon/addon/.gitkeep similarity index 100% rename from addon/.gitkeep rename to addon/addon/.gitkeep diff --git a/app/.gitkeep b/addon/app/.gitkeep similarity index 100% rename from app/.gitkeep rename to addon/app/.gitkeep diff --git a/config/ember-try.js b/addon/config/ember-try.js similarity index 100% rename from config/ember-try.js rename to addon/config/ember-try.js diff --git a/config/environment.js b/addon/config/environment.js similarity index 100% rename from config/environment.js rename to addon/config/environment.js diff --git a/ember-cli-build.js b/addon/ember-cli-build.js similarity index 100% rename from ember-cli-build.js rename to addon/ember-cli-build.js diff --git a/index.js b/addon/index.js similarity index 100% rename from index.js rename to addon/index.js diff --git a/package.json b/addon/package.json similarity index 100% rename from package.json rename to addon/package.json diff --git a/testem.js b/addon/testem.js similarity index 100% rename from testem.js rename to addon/testem.js diff --git a/tests/acceptance/basic-test.js b/addon/tests/acceptance/basic-test.js similarity index 100% rename from tests/acceptance/basic-test.js rename to addon/tests/acceptance/basic-test.js diff --git a/tests/dummy/app/app.js b/addon/tests/dummy/app/app.js similarity index 100% rename from tests/dummy/app/app.js rename to addon/tests/dummy/app/app.js diff --git a/tests/dummy/app/components/.gitkeep b/addon/tests/dummy/app/components/.gitkeep similarity index 100% rename from tests/dummy/app/components/.gitkeep rename to addon/tests/dummy/app/components/.gitkeep diff --git a/tests/dummy/app/controllers/.gitkeep b/addon/tests/dummy/app/controllers/.gitkeep similarity index 100% rename from tests/dummy/app/controllers/.gitkeep rename to addon/tests/dummy/app/controllers/.gitkeep diff --git a/tests/dummy/app/helpers/.gitkeep b/addon/tests/dummy/app/helpers/.gitkeep similarity index 100% rename from tests/dummy/app/helpers/.gitkeep rename to addon/tests/dummy/app/helpers/.gitkeep diff --git a/tests/dummy/app/index.html b/addon/tests/dummy/app/index.html similarity index 100% rename from tests/dummy/app/index.html rename to addon/tests/dummy/app/index.html diff --git a/tests/dummy/app/models/.gitkeep b/addon/tests/dummy/app/models/.gitkeep similarity index 100% rename from tests/dummy/app/models/.gitkeep rename to addon/tests/dummy/app/models/.gitkeep diff --git a/tests/dummy/app/resolver.js b/addon/tests/dummy/app/resolver.js similarity index 100% rename from tests/dummy/app/resolver.js rename to addon/tests/dummy/app/resolver.js diff --git a/tests/dummy/app/router.js b/addon/tests/dummy/app/router.js similarity index 100% rename from tests/dummy/app/router.js rename to addon/tests/dummy/app/router.js diff --git a/tests/dummy/app/routes/.gitkeep b/addon/tests/dummy/app/routes/.gitkeep similarity index 100% rename from tests/dummy/app/routes/.gitkeep rename to addon/tests/dummy/app/routes/.gitkeep diff --git a/tests/dummy/app/styles/app.css b/addon/tests/dummy/app/styles/app.css similarity index 100% rename from tests/dummy/app/styles/app.css rename to addon/tests/dummy/app/styles/app.css diff --git a/tests/dummy/app/templates/application.hbs b/addon/tests/dummy/app/templates/application.hbs similarity index 100% rename from tests/dummy/app/templates/application.hbs rename to addon/tests/dummy/app/templates/application.hbs diff --git a/tests/dummy/app/templates/components/.gitkeep b/addon/tests/dummy/app/templates/components/.gitkeep similarity index 100% rename from tests/dummy/app/templates/components/.gitkeep rename to addon/tests/dummy/app/templates/components/.gitkeep diff --git a/tests/dummy/config/ember-cli-update.json b/addon/tests/dummy/config/ember-cli-update.json similarity index 100% rename from tests/dummy/config/ember-cli-update.json rename to addon/tests/dummy/config/ember-cli-update.json diff --git a/tests/dummy/config/environment.js b/addon/tests/dummy/config/environment.js similarity index 100% rename from tests/dummy/config/environment.js rename to addon/tests/dummy/config/environment.js diff --git a/tests/dummy/config/optional-features.json b/addon/tests/dummy/config/optional-features.json similarity index 100% rename from tests/dummy/config/optional-features.json rename to addon/tests/dummy/config/optional-features.json diff --git a/tests/dummy/config/targets.js b/addon/tests/dummy/config/targets.js similarity index 100% rename from tests/dummy/config/targets.js rename to addon/tests/dummy/config/targets.js diff --git a/tests/dummy/public/crossdomain.xml b/addon/tests/dummy/public/crossdomain.xml similarity index 100% rename from tests/dummy/public/crossdomain.xml rename to addon/tests/dummy/public/crossdomain.xml diff --git a/tests/dummy/public/robots.txt b/addon/tests/dummy/public/robots.txt similarity index 100% rename from tests/dummy/public/robots.txt rename to addon/tests/dummy/public/robots.txt diff --git a/tests/helpers/destroy-app.js b/addon/tests/helpers/destroy-app.js similarity index 100% rename from tests/helpers/destroy-app.js rename to addon/tests/helpers/destroy-app.js diff --git a/tests/helpers/module-for-acceptance.js b/addon/tests/helpers/module-for-acceptance.js similarity index 100% rename from tests/helpers/module-for-acceptance.js rename to addon/tests/helpers/module-for-acceptance.js diff --git a/tests/helpers/resolver.js b/addon/tests/helpers/resolver.js similarity index 100% rename from tests/helpers/resolver.js rename to addon/tests/helpers/resolver.js diff --git a/tests/helpers/start-app.js b/addon/tests/helpers/start-app.js similarity index 100% rename from tests/helpers/start-app.js rename to addon/tests/helpers/start-app.js diff --git a/tests/index.html b/addon/tests/index.html similarity index 100% rename from tests/index.html rename to addon/tests/index.html diff --git a/tests/integration/.gitkeep b/addon/tests/integration/.gitkeep similarity index 100% rename from tests/integration/.gitkeep rename to addon/tests/integration/.gitkeep diff --git a/tests/integration/setup-rendering-test-test.js b/addon/tests/integration/setup-rendering-test-test.js similarity index 100% rename from tests/integration/setup-rendering-test-test.js rename to addon/tests/integration/setup-rendering-test-test.js diff --git a/tests/integration/setup-test-test.js b/addon/tests/integration/setup-test-test.js similarity index 100% rename from tests/integration/setup-test-test.js rename to addon/tests/integration/setup-test-test.js diff --git a/tests/test-helper.js b/addon/tests/test-helper.js similarity index 100% rename from tests/test-helper.js rename to addon/tests/test-helper.js diff --git a/tests/unit/.gitkeep b/addon/tests/unit/.gitkeep similarity index 100% rename from tests/unit/.gitkeep rename to addon/tests/unit/.gitkeep diff --git a/tests/unit/adapter-test.js b/addon/tests/unit/adapter-test.js similarity index 100% rename from tests/unit/adapter-test.js rename to addon/tests/unit/adapter-test.js diff --git a/tests/unit/ember-testing-test.js b/addon/tests/unit/ember-testing-test.js similarity index 100% rename from tests/unit/ember-testing-test.js rename to addon/tests/unit/ember-testing-test.js diff --git a/tests/unit/setup-ember-onerror-validation-test.js b/addon/tests/unit/setup-ember-onerror-validation-test.js similarity index 100% rename from tests/unit/setup-ember-onerror-validation-test.js rename to addon/tests/unit/setup-ember-onerror-validation-test.js diff --git a/tests/unit/test-isolation-validation-test.js b/addon/tests/unit/test-isolation-validation-test.js similarity index 100% rename from tests/unit/test-isolation-validation-test.js rename to addon/tests/unit/test-isolation-validation-test.js diff --git a/tests/unit/unhandled-rejection-test.js b/addon/tests/unit/unhandled-rejection-test.js similarity index 100% rename from tests/unit/unhandled-rejection-test.js rename to addon/tests/unit/unhandled-rejection-test.js diff --git a/tests/unit/utils/patch-assert-helper.js b/addon/tests/unit/utils/patch-assert-helper.js similarity index 100% rename from tests/unit/utils/patch-assert-helper.js rename to addon/tests/unit/utils/patch-assert-helper.js diff --git a/types/index.d.ts b/addon/types/index.d.ts similarity index 100% rename from types/index.d.ts rename to addon/types/index.d.ts diff --git a/types/local-types.d.ts b/addon/types/local-types.d.ts similarity index 100% rename from types/local-types.d.ts rename to addon/types/local-types.d.ts diff --git a/types/tests.ts b/addon/types/tests.ts similarity index 100% rename from types/tests.ts rename to addon/types/tests.ts diff --git a/types/tsconfig.json b/addon/types/tsconfig.json similarity index 100% rename from types/tsconfig.json rename to addon/types/tsconfig.json diff --git a/vendor/ember-cli/test-support-suffix.js b/addon/vendor/ember-cli/test-support-suffix.js similarity index 100% rename from vendor/ember-cli/test-support-suffix.js rename to addon/vendor/ember-cli/test-support-suffix.js diff --git a/vendor/ember-qunit/test-container-styles.css b/addon/vendor/ember-qunit/test-container-styles.css similarity index 100% rename from vendor/ember-qunit/test-container-styles.css rename to addon/vendor/ember-qunit/test-container-styles.css From d9a54f1e2fbc7abb3658c077f5b97d4d26a2e1f1 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Tue, 2 May 2023 11:12:05 -0400 Subject: [PATCH 02/21] Make gitignore work for all directories --- .gitignore | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index 57f1ade9..953ae42b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,33 +1,33 @@ # See https://help.github.com/ignore-files/ for more about ignoring files. # compiled output -/dist/ -/tmp/ -/.eslintcache +dist/ +tmp/ +.eslintcache # dependencies -/bower_components/ -/node_modules/ +bower_components/ +node_modules/ # misc -/.env* -/.pnp* -/.sass-cache -/.eslintcache -/connect.lock -/coverage/ -/libpeerconnection.log -/npm-debug.log* -/testem.log -/yarn-error.log +.env* +.pnp* +.sass-cache +.eslintcache +connect.lock +coverage/ +libpeerconnection.log +npm-debug.log* +testem.log +yarn-error.log # ember-try -/.node_modules.ember-try/ -/bower.json.ember-try -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try +.node_modules.ember-try/ +bower.json.ember-try +npm-shrinkwrap.json.ember-try +package.json.ember-try +package-lock.json.ember-try +yarn.lock.ember-try # broccoli-debug -/DEBUG/ +DEBUG/ From a6ffed0b11c753585185eb8fb92f9267cbef01b4 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Tue, 2 May 2023 11:15:17 -0400 Subject: [PATCH 03/21] Add root package.json --- package.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 package.json diff --git a/package.json b/package.json new file mode 100644 index 00000000..482d9b22 --- /dev/null +++ b/package.json @@ -0,0 +1,19 @@ +{ + "name": "root", + "version": "0.0.0", + "private": true, + "license": "MIT", + "repository": "https://github.com/emberjs/ember-qunit", + "scripts": { + "lint": "yarn workspaces run lint", + "lint:fix": "yarn workspaces run lint:fix", + "test": "yarn workspaces run test" + }, + "workspaces": [ + "addon" + ], + "volta": { + "node": "16.20.0", + "yarn": "1.22.19" + } +} From fc14482a9ea0bf517516679d0b8fc3fe95f981aa Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Tue, 2 May 2023 11:16:16 -0400 Subject: [PATCH 04/21] Update CI --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dfbb27d5..49011ef7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,7 @@ jobs: - run: yarn install --frozen-lockfile - run: yarn lint - run: yarn test:ember + working-directory: addon floating-dependencies: name: 'Floating Dependencies' @@ -36,6 +37,7 @@ jobs: - uses: volta-cli/action@v4 - run: yarn install --no-lockfile - run: yarn test:ember + working-directory: addon try-scenarios: name: 'Try: ${{ matrix.ember-try-scenario }}' @@ -64,6 +66,7 @@ jobs: run: yarn install --frozen-lockfile - name: test run: node_modules/.bin/ember try:one ${{ matrix.ember-try-scenario }} --skip-cleanup + working-directory: addon types: runs-on: ubuntu-latest @@ -85,5 +88,7 @@ jobs: run: yarn install --frozen-lockfile - name: install TS version run: yarn install --dev typescript@${{matrix.ts-version}} + working-directory: addon - name: test types run: yarn test:types + working-directory: addon From 5862d31192101b62b9092eac68d20f41714d3902 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Tue, 2 May 2023 15:20:31 -0400 Subject: [PATCH 05/21] Ember v5 requires @ember/string be added --- addon/package.json | 1 + yarn.lock | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/addon/package.json b/addon/package.json index d50065b3..6517332a 100644 --- a/addon/package.json +++ b/addon/package.json @@ -49,6 +49,7 @@ "@babel/core": "^7.21.0", "@babel/eslint-parser": "^7.19.1", "@ember/optional-features": "^2.0.0", + "@ember/string": "^3.0.1", "@ember/test-helpers": "^2.9.3", "@embroider/test-setup": "^2.1.1", "@glimmer/component": "^1.1.2", diff --git a/yarn.lock b/yarn.lock index c9bc9610..2fcbf864 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1037,6 +1037,13 @@ mkdirp "^1.0.4" silent-error "^1.1.1" +"@ember/string@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@ember/string/-/string-3.0.1.tgz#42cf032031a4432c2dd69c327ae1876d2c13df9c" + integrity sha512-ntnmXS+upOWVXE+rVw2l03DjdMnaGdWbYVUxUBuPJqnIGZu2XFRsoXc7E6mOw62s8i1Xh1RgTuFHN41QGIolEQ== + dependencies: + ember-cli-babel "^7.26.6" + "@ember/test-helpers@^2.9.3": version "2.9.3" resolved "https://registry.yarnpkg.com/@ember/test-helpers/-/test-helpers-2.9.3.tgz#c2a9d6ab1c367af92cf1a334f97eb19b8e06e6e1" From 4d211f725911155f1a4a2d5621528e398e81c6cd Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Wed, 3 May 2023 18:33:41 -0400 Subject: [PATCH 06/21] Initial extraction --- package.json | 3 +- test-app/.editorconfig | 19 + test-app/.ember-cli | 15 + test-app/.eslintignore | 25 ++ test-app/.eslintrc.js | 66 ++++ test-app/.npmignore | 40 ++ test-app/.prettierignore | 25 ++ test-app/.prettierrc.js | 5 + test-app/.watchmanconfig | 3 + {addon => test-app}/config/ember-try.js | 0 test-app/config/environment.js | 6 + test-app/ember-cli-build.js | 38 ++ test-app/index.js | 102 ++++++ test-app/package.json | 124 +++++++ test-app/testem.js | 23 ++ .../tests/acceptance/basic-test.js | 0 {addon => test-app}/tests/dummy/app/app.js | 0 .../tests/dummy/app/components/.gitkeep | 0 .../tests/dummy/app/controllers/.gitkeep | 0 .../tests/dummy/app/helpers/.gitkeep | 0 .../tests/dummy/app/index.html | 0 .../tests/dummy/app/models/.gitkeep | 0 .../tests/dummy/app/resolver.js | 0 {addon => test-app}/tests/dummy/app/router.js | 0 .../tests/dummy/app/routes/.gitkeep | 0 .../tests/dummy/app/styles/app.css | 0 .../tests/dummy/app/templates/application.hbs | 0 .../dummy/app/templates/components/.gitkeep | 0 .../tests/dummy/config/ember-cli-update.json | 0 .../tests/dummy/config/environment.js | 0 .../tests/dummy/config/optional-features.json | 0 .../tests/dummy/config/targets.js | 0 .../tests/dummy/public/crossdomain.xml | 0 .../tests/dummy/public/robots.txt | 0 .../tests/helpers/destroy-app.js | 0 .../tests/helpers/module-for-acceptance.js | 0 {addon => test-app}/tests/helpers/resolver.js | 0 .../tests/helpers/start-app.js | 0 {addon => test-app}/tests/index.html | 0 .../tests/integration/.gitkeep | 0 .../integration/setup-rendering-test-test.js | 0 .../tests/integration/setup-test-test.js | 0 {addon => test-app}/tests/test-helper.js | 0 {addon => test-app}/tests/unit/.gitkeep | 0 .../tests/unit/adapter-test.js | 0 .../tests/unit/ember-testing-test.js | 0 .../setup-ember-onerror-validation-test.js | 0 .../unit/test-isolation-validation-test.js | 0 .../tests/unit/unhandled-rejection-test.js | 0 .../tests/unit/utils/patch-assert-helper.js | 0 test-app/types/index.d.ts | 272 ++++++++++++++ test-app/types/local-types.d.ts | 2 + test-app/types/tests.ts | 342 ++++++++++++++++++ test-app/types/tsconfig.json | 11 + yarn.lock | 13 + 55 files changed, 1133 insertions(+), 1 deletion(-) create mode 100644 test-app/.editorconfig create mode 100644 test-app/.ember-cli create mode 100644 test-app/.eslintignore create mode 100644 test-app/.eslintrc.js create mode 100644 test-app/.npmignore create mode 100644 test-app/.prettierignore create mode 100644 test-app/.prettierrc.js create mode 100644 test-app/.watchmanconfig rename {addon => test-app}/config/ember-try.js (100%) create mode 100644 test-app/config/environment.js create mode 100644 test-app/ember-cli-build.js create mode 100644 test-app/index.js create mode 100644 test-app/package.json create mode 100644 test-app/testem.js rename {addon => test-app}/tests/acceptance/basic-test.js (100%) rename {addon => test-app}/tests/dummy/app/app.js (100%) rename {addon => test-app}/tests/dummy/app/components/.gitkeep (100%) rename {addon => test-app}/tests/dummy/app/controllers/.gitkeep (100%) rename {addon => test-app}/tests/dummy/app/helpers/.gitkeep (100%) rename {addon => test-app}/tests/dummy/app/index.html (100%) rename {addon => test-app}/tests/dummy/app/models/.gitkeep (100%) rename {addon => test-app}/tests/dummy/app/resolver.js (100%) rename {addon => test-app}/tests/dummy/app/router.js (100%) rename {addon => test-app}/tests/dummy/app/routes/.gitkeep (100%) rename {addon => test-app}/tests/dummy/app/styles/app.css (100%) rename {addon => test-app}/tests/dummy/app/templates/application.hbs (100%) rename {addon => test-app}/tests/dummy/app/templates/components/.gitkeep (100%) rename {addon => test-app}/tests/dummy/config/ember-cli-update.json (100%) rename {addon => test-app}/tests/dummy/config/environment.js (100%) rename {addon => test-app}/tests/dummy/config/optional-features.json (100%) rename {addon => test-app}/tests/dummy/config/targets.js (100%) rename {addon => test-app}/tests/dummy/public/crossdomain.xml (100%) rename {addon => test-app}/tests/dummy/public/robots.txt (100%) rename {addon => test-app}/tests/helpers/destroy-app.js (100%) rename {addon => test-app}/tests/helpers/module-for-acceptance.js (100%) rename {addon => test-app}/tests/helpers/resolver.js (100%) rename {addon => test-app}/tests/helpers/start-app.js (100%) rename {addon => test-app}/tests/index.html (100%) rename {addon => test-app}/tests/integration/.gitkeep (100%) rename {addon => test-app}/tests/integration/setup-rendering-test-test.js (100%) rename {addon => test-app}/tests/integration/setup-test-test.js (100%) rename {addon => test-app}/tests/test-helper.js (100%) rename {addon => test-app}/tests/unit/.gitkeep (100%) rename {addon => test-app}/tests/unit/adapter-test.js (100%) rename {addon => test-app}/tests/unit/ember-testing-test.js (100%) rename {addon => test-app}/tests/unit/setup-ember-onerror-validation-test.js (100%) rename {addon => test-app}/tests/unit/test-isolation-validation-test.js (100%) rename {addon => test-app}/tests/unit/unhandled-rejection-test.js (100%) rename {addon => test-app}/tests/unit/utils/patch-assert-helper.js (100%) create mode 100644 test-app/types/index.d.ts create mode 100644 test-app/types/local-types.d.ts create mode 100644 test-app/types/tests.ts create mode 100644 test-app/types/tsconfig.json diff --git a/package.json b/package.json index 482d9b22..88a21e32 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "test": "yarn workspaces run test" }, "workspaces": [ - "addon" + "addon", + "test-app" ], "volta": { "node": "16.20.0", diff --git a/test-app/.editorconfig b/test-app/.editorconfig new file mode 100644 index 00000000..c35a0024 --- /dev/null +++ b/test-app/.editorconfig @@ -0,0 +1,19 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# editorconfig.org + +root = true + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = space +indent_size = 2 + +[*.hbs] +insert_final_newline = false + +[*.{diff,md}] +trim_trailing_whitespace = false diff --git a/test-app/.ember-cli b/test-app/.ember-cli new file mode 100644 index 00000000..4ccb4bf4 --- /dev/null +++ b/test-app/.ember-cli @@ -0,0 +1,15 @@ +{ + /** + Ember CLI sends analytics information by default. The data is completely + anonymous, but there are times when you might want to disable this behavior. + + Setting `disableAnalytics` to true will prevent any data from being sent. + */ + "disableAnalytics": false, + + /** + Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript + rather than JavaScript by default, when a TypeScript version of a given blueprint is available. + */ + "isTypeScriptProject": false +} diff --git a/test-app/.eslintignore b/test-app/.eslintignore new file mode 100644 index 00000000..d474a40b --- /dev/null +++ b/test-app/.eslintignore @@ -0,0 +1,25 @@ +# unconventional js +/blueprints/*/files/ +/vendor/ + +# compiled output +/dist/ +/tmp/ + +# dependencies +/bower_components/ +/node_modules/ + +# misc +/coverage/ +!.* +.*/ +.eslintcache + +# ember-try +/.node_modules.ember-try/ +/bower.json.ember-try +/npm-shrinkwrap.json.ember-try +/package.json.ember-try +/package-lock.json.ember-try +/yarn.lock.ember-try diff --git a/test-app/.eslintrc.js b/test-app/.eslintrc.js new file mode 100644 index 00000000..1dd2a810 --- /dev/null +++ b/test-app/.eslintrc.js @@ -0,0 +1,66 @@ +'use strict'; + +module.exports = { + root: true, + extends: ['eslint:recommended', 'plugin:prettier/recommended'], + plugins: ['prettier'], + parser: '@babel/eslint-parser', + parserOptions: { + ecmaVersion: 2017, + sourceType: 'module', + requireConfigFile: false, // allow @babel/eslint-parser to run on files that do not have a Babel configuration associated with them + }, + env: { + browser: true, + }, + rules: {}, + overrides: [ + // node files + { + files: [ + '.eslintrc.js', + '.prettierrc.js', + '.template-lintrc.js', + 'ember-cli-build.js', + 'index.js', + 'testem.js', + 'blueprints/*/index.js', + 'config/**/*.js', + 'tests/dummy/config/**/*.js', + ], + excludedFiles: [ + 'addon/**', + 'addon-test-support/**', + 'tests/dummy/app/**', + 'vendor/**', + ], + parserOptions: { + sourceType: 'script', + }, + env: { + browser: false, + node: true, + }, + plugins: ['node'], + extends: ['plugin:node/recommended'], + }, + + // test files + { + files: ['tests/**/*.js'], + env: { + qunit: true, + }, + }, + + // ensure we do not accidentally land async/await in shipped addon-test-support + { + files: ['addon-test-support/**/*.js'], + plugins: ['disable-features'], + rules: { + 'disable-features/disable-async-await': 'error', + 'disable-features/disable-generator-functions': 'error', + }, + }, + ], +}; diff --git a/test-app/.npmignore b/test-app/.npmignore new file mode 100644 index 00000000..3aac2443 --- /dev/null +++ b/test-app/.npmignore @@ -0,0 +1,40 @@ +# compiled output +/dist/ +/tmp/ + +# dependencies +/bower_components/ + +# misc +/.bowerrc +/.editorconfig +/.ember-cli +/.env* +/.eslintcache +/.eslintignore +/.eslintrc.js +/.git/ +/.github/ +/.gitignore +/.prettierignore +/.prettierrc.js +/.template-lintrc.js +/.travis.yml +/.watchmanconfig +/bower.json +/config/ember-try.js +/CONTRIBUTING.md +/ember-cli-build.js +/testem.js +/tests/ +/yarn-error.log +/yarn.lock +.gitkeep + +# ember-try +/.node_modules.ember-try/ +/bower.json.ember-try +/npm-shrinkwrap.json.ember-try +/package.json.ember-try +/package-lock.json.ember-try +/yarn.lock.ember-try diff --git a/test-app/.prettierignore b/test-app/.prettierignore new file mode 100644 index 00000000..4178fd57 --- /dev/null +++ b/test-app/.prettierignore @@ -0,0 +1,25 @@ +# unconventional js +/blueprints/*/files/ +/vendor/ + +# compiled output +/dist/ +/tmp/ + +# dependencies +/bower_components/ +/node_modules/ + +# misc +/coverage/ +!.* +.eslintcache +.lint-todo/ + +# ember-try +/.node_modules.ember-try/ +/bower.json.ember-try +/npm-shrinkwrap.json.ember-try +/package.json.ember-try +/package-lock.json.ember-try +/yarn.lock.ember-try diff --git a/test-app/.prettierrc.js b/test-app/.prettierrc.js new file mode 100644 index 00000000..534e6d35 --- /dev/null +++ b/test-app/.prettierrc.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = { + singleQuote: true, +}; diff --git a/test-app/.watchmanconfig b/test-app/.watchmanconfig new file mode 100644 index 00000000..e7834e3e --- /dev/null +++ b/test-app/.watchmanconfig @@ -0,0 +1,3 @@ +{ + "ignore_dirs": ["tmp", "dist"] +} diff --git a/addon/config/ember-try.js b/test-app/config/ember-try.js similarity index 100% rename from addon/config/ember-try.js rename to test-app/config/ember-try.js diff --git a/test-app/config/environment.js b/test-app/config/environment.js new file mode 100644 index 00000000..9b5d25d2 --- /dev/null +++ b/test-app/config/environment.js @@ -0,0 +1,6 @@ +/* eslint-env node */ +'use strict'; + +module.exports = function (/* environment, appConfig */) { + return {}; +}; diff --git a/test-app/ember-cli-build.js b/test-app/ember-cli-build.js new file mode 100644 index 00000000..14758d0d --- /dev/null +++ b/test-app/ember-cli-build.js @@ -0,0 +1,38 @@ +/* eslint-env node */ +'use strict'; + +const EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); + +module.exports = function (defaults) { + const app = new EmberAddon(defaults, { + eslint: { + testGenerator: 'qunit', + }, + }); + + const { maybeEmbroider } = require('@embroider/test-setup'); + return maybeEmbroider(app, { + packageRules: [ + { + // See: https://github.com/embroider-build/embroider/issues/522 + package: 'dummy', + components: { + '{{template-only}}': { + safeToIgnore: true, + }, + '{{js-only}}': { + safeToIgnore: true, + }, + '{{jax}}': { + safeToIgnore: true, + }, + }, + }, + ], + skipBabel: [ + { + package: 'qunit', + }, + ], + }); +}; diff --git a/test-app/index.js b/test-app/index.js new file mode 100644 index 00000000..d665622b --- /dev/null +++ b/test-app/index.js @@ -0,0 +1,102 @@ +/* eslint-env node */ +'use strict'; + +const path = require('path'); +const resolvePackagePath = require('resolve-package-path'); +const stripIndent = require('common-tags').stripIndent; + +const validatePeerDependencies = require('validate-peer-dependencies'); + +module.exports = { + name: 'ember-qunit', + + init() { + this._super.init && this._super.init.apply(this, arguments); + + this.setTestGenerator(); + }, + + included() { + this._super.included.apply(this, arguments); + + validatePeerDependencies(__dirname, { + resolvePackagePathFrom: this.parent.root, + }); + + // TODO: figure out how to make this not needed, AFAICT ember-auto-import + // does not provide any ability to import styles + this.import('vendor/qunit/qunit.css', { type: 'test' }); + + let addonOptions = this.targetOptions(); + let explicitlyDisabledStyles = addonOptions.disableContainerStyles === true; + if (!explicitlyDisabledStyles) { + this.import('vendor/ember-qunit/test-container-styles.css', { + type: 'test', + }); + } + }, + + targetOptions() { + if (!this._targetOptions) { + // 1. check this.parent.options['ember-qunit'] + let targetOptions = + this.parent.options && this.parent.options['ember-qunit']; + + // 2. check this.app.options['ember-qunit'] + targetOptions = + targetOptions || + (this.app && this.app.options && this.app.options['ember-qunit']); + this._targetOptions = targetOptions || {}; + } + + return this._targetOptions; + }, + + treeForVendor: function (tree) { + const MergeTrees = require('broccoli-merge-trees'); + const Funnel = require('broccoli-funnel'); + + let qunitPackagePath = resolvePackagePath('qunit', this.parent.root); + let qunitPath = path.join(path.dirname(qunitPackagePath), 'qunit'); + + let qunitTree = new Funnel(this.treeGenerator(qunitPath), { + destDir: 'qunit', + annotation: 'ember-qunit#treeForVendor', + }); + + return new MergeTrees([qunitTree, tree]); + }, + + treeForAddonTestSupport(tree) { + // intentionally not calling _super here + // so that can have our `import`'s be + // import { ... } from 'ember-qunit'; + + const Funnel = require('broccoli-funnel'); + + let scopedInputTree = new Funnel(tree, { destDir: 'ember-qunit' }); + + return this.preprocessJs(scopedInputTree, '/', this.name, { + annotation: `ember-qunit - treeForAddonTestSupport`, + registry: this.registry, + treeType: 'addon-test-support', + }); + }, + + setTestGenerator: function () { + this.project.generateTestFile = function (moduleName, tests) { + let output = `QUnit.module('${moduleName}');\n`; + + tests.forEach(function (test) { + output += stripIndent` + QUnit.test('${test.name}', function(assert) { + assert.expect(1); + assert.ok(${test.passed}, '${test.errorMessage}'); + }); + `; + }); + + return output; + }; + }, +}; diff --git a/test-app/package.json b/test-app/package.json new file mode 100644 index 00000000..5470bb0a --- /dev/null +++ b/test-app/package.json @@ -0,0 +1,124 @@ +{ + "name": "test-app", + "version": "0.0.0", + "description": "Test app for ember-qunit", + "keywords": [ + "ember-addon" + ], + "repository": { + "type": "git", + "url": "https://github.com/emberjs/ember-qunit.git" + }, + "license": "MIT", + "contributors": [ + "Stefan Penner", + "Ryan Florence", + "Robert Jackson", + "Dan Gebhardt", + "Steve Calvert" + ], + "directories": { + "doc": "doc", + "test": "tests" + }, + "types": "types/index.d.ts", + "scripts": { + "build": "ember build --environment=production", + "lint": "npm-run-all --print-name --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"", + "lint:fix": "npm-run-all --print-name --aggregate-output --continue-on-error --parallel \"lint:*:fix\"", + "lint:js": "eslint . --cache", + "lint:js:fix": "eslint . --fix", + "start": "ember serve", + "test": "npm-run-all --print-name \"lint\" \"test:*\"", + "test:types": "tsc --noEmit --project types", + "test:ember": "ember test", + "test:ember-compatibility": "ember try:each" + }, + "dependencies": { + "ember-qunit": "link:../addon" + }, + "devDependencies": { + "@babel/core": "^7.21.0", + "@babel/eslint-parser": "^7.19.1", + "@ember/optional-features": "^2.0.0", + "@ember/string": "^3.0.1", + "@ember/test-helpers": "^2.9.3", + "@embroider/test-setup": "^2.1.1", + "@glimmer/component": "^1.1.2", + "@tsconfig/ember": "^2.0.0", + "@types/qunit": "^2.19.4", + "@types/rsvp": "^4.0.4", + "ember-angle-bracket-invocation-polyfill": "^3.0.2", + "ember-cli": "~4.10.0", + "ember-cli-dependency-checker": "^3.3.1", + "ember-cli-htmlbars": "^6.2.0", + "ember-cli-inject-live-reload": "^2.1.0", + "ember-cli-terser": "^4.0.2", + "ember-disable-prototype-extensions": "^1.1.3", + "ember-load-initializers": "^2.1.2", + "ember-resolver": "^9.0.1", + "ember-source": "~4.10.0", + "ember-source-channel-url": "^3.0.0", + "ember-try": "^2.0.0", + "eslint": "^8.35.0", + "eslint-config-prettier": "^8.6.0", + "eslint-plugin-disable-features": "^0.1.3", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-prettier": "^4.2.1", + "expect-type": "^0.15.0", + "loader.js": "^4.7.0", + "npm-run-all": "^4.1.5", + "prettier": "2.8.4", + "qunit": "^2.19.4", + "release-it": "^15.7.0", + "release-it-lerna-changelog": "^5.0.0", + "typescript": "^4.9.5", + "webpack": "^5.75.0" + }, + "peerDependencies": { + "@ember/test-helpers": "^2.9.3", + "ember-source": ">=3.28", + "qunit": "^2.13.0" + }, + "engines": { + "node": "14.* || 16.* || >= 18" + }, + "publishConfig": { + "registry": "https://registry.npmjs.org" + }, + "changelog": { + "repo": "emberjs/ember-qunit", + "labels": { + "breaking": ":boom: Breaking Change", + "enhancement": ":rocket: Enhancement", + "bug": ":bug: Bug Fix", + "documentation": ":memo: Documentation", + "internal": ":house: Internal" + } + }, + "ember": { + "edition": "octane" + }, + "ember-addon": { + "configPath": "tests/dummy/config" + }, + "release-it": { + "plugins": { + "release-it-lerna-changelog": { + "infile": "CHANGELOG.md", + "launchEditor": true + } + }, + "git": { + "tagName": "v${version}" + }, + "github": { + "release": true, + "tokenRef": "GITHUB_AUTH" + } + }, + "volta": { + "node": "14.19.1", + "yarn": "1.22.18" + } +} diff --git a/test-app/testem.js b/test-app/testem.js new file mode 100644 index 00000000..ed2f3712 --- /dev/null +++ b/test-app/testem.js @@ -0,0 +1,23 @@ +'use strict'; + +module.exports = { + test_page: 'tests/index.html?hidepassed', + disable_watching: true, + launch_in_ci: ['Chrome'], + launch_in_dev: ['Chrome'], + browser_start_timeout: 120, + browser_args: { + Chrome: { + ci: [ + // --no-sandbox is needed when running Chrome inside a container + process.env.CI ? '--no-sandbox' : null, + '--headless', + '--disable-dev-shm-usage', + '--disable-software-rasterizer', + '--mute-audio', + '--remote-debugging-port=0', + '--window-size=1440,900', + ].filter(Boolean), + }, + }, +}; diff --git a/addon/tests/acceptance/basic-test.js b/test-app/tests/acceptance/basic-test.js similarity index 100% rename from addon/tests/acceptance/basic-test.js rename to test-app/tests/acceptance/basic-test.js diff --git a/addon/tests/dummy/app/app.js b/test-app/tests/dummy/app/app.js similarity index 100% rename from addon/tests/dummy/app/app.js rename to test-app/tests/dummy/app/app.js diff --git a/addon/tests/dummy/app/components/.gitkeep b/test-app/tests/dummy/app/components/.gitkeep similarity index 100% rename from addon/tests/dummy/app/components/.gitkeep rename to test-app/tests/dummy/app/components/.gitkeep diff --git a/addon/tests/dummy/app/controllers/.gitkeep b/test-app/tests/dummy/app/controllers/.gitkeep similarity index 100% rename from addon/tests/dummy/app/controllers/.gitkeep rename to test-app/tests/dummy/app/controllers/.gitkeep diff --git a/addon/tests/dummy/app/helpers/.gitkeep b/test-app/tests/dummy/app/helpers/.gitkeep similarity index 100% rename from addon/tests/dummy/app/helpers/.gitkeep rename to test-app/tests/dummy/app/helpers/.gitkeep diff --git a/addon/tests/dummy/app/index.html b/test-app/tests/dummy/app/index.html similarity index 100% rename from addon/tests/dummy/app/index.html rename to test-app/tests/dummy/app/index.html diff --git a/addon/tests/dummy/app/models/.gitkeep b/test-app/tests/dummy/app/models/.gitkeep similarity index 100% rename from addon/tests/dummy/app/models/.gitkeep rename to test-app/tests/dummy/app/models/.gitkeep diff --git a/addon/tests/dummy/app/resolver.js b/test-app/tests/dummy/app/resolver.js similarity index 100% rename from addon/tests/dummy/app/resolver.js rename to test-app/tests/dummy/app/resolver.js diff --git a/addon/tests/dummy/app/router.js b/test-app/tests/dummy/app/router.js similarity index 100% rename from addon/tests/dummy/app/router.js rename to test-app/tests/dummy/app/router.js diff --git a/addon/tests/dummy/app/routes/.gitkeep b/test-app/tests/dummy/app/routes/.gitkeep similarity index 100% rename from addon/tests/dummy/app/routes/.gitkeep rename to test-app/tests/dummy/app/routes/.gitkeep diff --git a/addon/tests/dummy/app/styles/app.css b/test-app/tests/dummy/app/styles/app.css similarity index 100% rename from addon/tests/dummy/app/styles/app.css rename to test-app/tests/dummy/app/styles/app.css diff --git a/addon/tests/dummy/app/templates/application.hbs b/test-app/tests/dummy/app/templates/application.hbs similarity index 100% rename from addon/tests/dummy/app/templates/application.hbs rename to test-app/tests/dummy/app/templates/application.hbs diff --git a/addon/tests/dummy/app/templates/components/.gitkeep b/test-app/tests/dummy/app/templates/components/.gitkeep similarity index 100% rename from addon/tests/dummy/app/templates/components/.gitkeep rename to test-app/tests/dummy/app/templates/components/.gitkeep diff --git a/addon/tests/dummy/config/ember-cli-update.json b/test-app/tests/dummy/config/ember-cli-update.json similarity index 100% rename from addon/tests/dummy/config/ember-cli-update.json rename to test-app/tests/dummy/config/ember-cli-update.json diff --git a/addon/tests/dummy/config/environment.js b/test-app/tests/dummy/config/environment.js similarity index 100% rename from addon/tests/dummy/config/environment.js rename to test-app/tests/dummy/config/environment.js diff --git a/addon/tests/dummy/config/optional-features.json b/test-app/tests/dummy/config/optional-features.json similarity index 100% rename from addon/tests/dummy/config/optional-features.json rename to test-app/tests/dummy/config/optional-features.json diff --git a/addon/tests/dummy/config/targets.js b/test-app/tests/dummy/config/targets.js similarity index 100% rename from addon/tests/dummy/config/targets.js rename to test-app/tests/dummy/config/targets.js diff --git a/addon/tests/dummy/public/crossdomain.xml b/test-app/tests/dummy/public/crossdomain.xml similarity index 100% rename from addon/tests/dummy/public/crossdomain.xml rename to test-app/tests/dummy/public/crossdomain.xml diff --git a/addon/tests/dummy/public/robots.txt b/test-app/tests/dummy/public/robots.txt similarity index 100% rename from addon/tests/dummy/public/robots.txt rename to test-app/tests/dummy/public/robots.txt diff --git a/addon/tests/helpers/destroy-app.js b/test-app/tests/helpers/destroy-app.js similarity index 100% rename from addon/tests/helpers/destroy-app.js rename to test-app/tests/helpers/destroy-app.js diff --git a/addon/tests/helpers/module-for-acceptance.js b/test-app/tests/helpers/module-for-acceptance.js similarity index 100% rename from addon/tests/helpers/module-for-acceptance.js rename to test-app/tests/helpers/module-for-acceptance.js diff --git a/addon/tests/helpers/resolver.js b/test-app/tests/helpers/resolver.js similarity index 100% rename from addon/tests/helpers/resolver.js rename to test-app/tests/helpers/resolver.js diff --git a/addon/tests/helpers/start-app.js b/test-app/tests/helpers/start-app.js similarity index 100% rename from addon/tests/helpers/start-app.js rename to test-app/tests/helpers/start-app.js diff --git a/addon/tests/index.html b/test-app/tests/index.html similarity index 100% rename from addon/tests/index.html rename to test-app/tests/index.html diff --git a/addon/tests/integration/.gitkeep b/test-app/tests/integration/.gitkeep similarity index 100% rename from addon/tests/integration/.gitkeep rename to test-app/tests/integration/.gitkeep diff --git a/addon/tests/integration/setup-rendering-test-test.js b/test-app/tests/integration/setup-rendering-test-test.js similarity index 100% rename from addon/tests/integration/setup-rendering-test-test.js rename to test-app/tests/integration/setup-rendering-test-test.js diff --git a/addon/tests/integration/setup-test-test.js b/test-app/tests/integration/setup-test-test.js similarity index 100% rename from addon/tests/integration/setup-test-test.js rename to test-app/tests/integration/setup-test-test.js diff --git a/addon/tests/test-helper.js b/test-app/tests/test-helper.js similarity index 100% rename from addon/tests/test-helper.js rename to test-app/tests/test-helper.js diff --git a/addon/tests/unit/.gitkeep b/test-app/tests/unit/.gitkeep similarity index 100% rename from addon/tests/unit/.gitkeep rename to test-app/tests/unit/.gitkeep diff --git a/addon/tests/unit/adapter-test.js b/test-app/tests/unit/adapter-test.js similarity index 100% rename from addon/tests/unit/adapter-test.js rename to test-app/tests/unit/adapter-test.js diff --git a/addon/tests/unit/ember-testing-test.js b/test-app/tests/unit/ember-testing-test.js similarity index 100% rename from addon/tests/unit/ember-testing-test.js rename to test-app/tests/unit/ember-testing-test.js diff --git a/addon/tests/unit/setup-ember-onerror-validation-test.js b/test-app/tests/unit/setup-ember-onerror-validation-test.js similarity index 100% rename from addon/tests/unit/setup-ember-onerror-validation-test.js rename to test-app/tests/unit/setup-ember-onerror-validation-test.js diff --git a/addon/tests/unit/test-isolation-validation-test.js b/test-app/tests/unit/test-isolation-validation-test.js similarity index 100% rename from addon/tests/unit/test-isolation-validation-test.js rename to test-app/tests/unit/test-isolation-validation-test.js diff --git a/addon/tests/unit/unhandled-rejection-test.js b/test-app/tests/unit/unhandled-rejection-test.js similarity index 100% rename from addon/tests/unit/unhandled-rejection-test.js rename to test-app/tests/unit/unhandled-rejection-test.js diff --git a/addon/tests/unit/utils/patch-assert-helper.js b/test-app/tests/unit/utils/patch-assert-helper.js similarity index 100% rename from addon/tests/unit/utils/patch-assert-helper.js rename to test-app/tests/unit/utils/patch-assert-helper.js diff --git a/test-app/types/index.d.ts b/test-app/types/index.d.ts new file mode 100644 index 00000000..d11b83d5 --- /dev/null +++ b/test-app/types/index.d.ts @@ -0,0 +1,272 @@ +// Type definitions for ember-qunit 5.0 +// Project: https://github.com/emberjs/ember-qunit#readme +// Definitions by: Dan Freeman +// Chris Krycho +// James C. Davis +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Minimum TypeScript Version: 4.4 + +import EmberTestAdapter from '@ember/test/adapter'; +import { Resolver } from '@ember/owner'; +import { TestContext } from '@ember/test-helpers'; + +/** + * Sets a Resolver globally which will be used to look up objects from each test's container. + */ +export function setResolver(resolver: Resolver): void; + +/** + * Options for configuring the test runner. Normally, you will not need to + * customize this. It is exported primarily so that end user app code can name + * it when passing it back to the framework. + */ +export interface SetupTestOptions { + /** + * The resolver to use when instantiating container-managed entities in the test. + */ + resolver?: Resolver | undefined; +} + +/** + * Sets up acceptance tests. + * + * The `setupApplicationTest` function is used for all acceptance tests. It + * is invoked in the callback scope of a QUnit module (aka "nested module"). + * + * Once invoked, all subsequent hooks.beforeEach and test invocations will + * have access to the following: + * * `this.owner` - the owner object that been set on the test context. + * * `this.pauseTest` and `this.resumeTest` - allow easy pausing/resuming of tests. + * * `this.element` which returns the DOM element representing the application's root element. + */ +export function setupApplicationTest( + hooks: NestedHooks, + options?: SetupTestOptions +): void; + +/** + * Sets up tests that need to render snippets of templates. + * + * The setupRenderingTest method is used for tests that need to render + * snippets of templates. It is also invoked in the callback scope of a + * QUnit module (aka "nested module"). + * + * Once invoked, all subsequent hooks.beforeEach and test invocations will + * have access to the following: + * * All of the methods / properties listed for `setupTest` + * * this.render(...) - Renders the provided template snippet returning a + * promise that resolves once rendering has completed + * * An importable render function that de-sugars into this.render will be + * the default output of blueprints + * * this.element - Returns the native DOM element representing the element + * that was rendered via this.render + * * this.$(...) - When jQuery is present, executes a jQuery selector with + * the current this.element as its root + */ +export function setupRenderingTest( + hooks: NestedHooks, + options?: SetupTestOptions +): void; + +/** + * Sets up tests that do not need to render snippets of templates. + * + * The `setupTest` method is used for all types of tests except for those + * that need to render snippets of templates. It is invoked in the callback + * scope of a QUnit module (aka "nested module"). + * + * Once invoked, all subsequent hooks.beforeEach and test invocations will + * have access to the following: + * * this.owner - This exposes the standard "owner API" for the test environment. + * * this.set / this.setProperties - Allows setting values on the test context. + * * this.get / this.getProperties - Retrieves values from the test context. + */ +export function setupTest(hooks: NestedHooks, options?: SetupTestOptions): void; + +export class QUnitAdapter extends EmberTestAdapter {} + +export { module, test, skip, only, todo } from 'qunit'; + +interface QUnitStartOptions { + /** + * If `false` tests will not be loaded automatically. + */ + loadTests?: boolean | undefined; + + /** + * If `false` the test container will not be setup based on `devmode`, + * `dockcontainer`, or `nocontainer` URL params. + */ + setupTestContainer?: boolean | undefined; + + /** + * If `false` tests will not be automatically started (you must run + * `QUnit.start()` to kick them off). + */ + startTests?: boolean | undefined; + + /** + * If `false` the default Ember.Test adapter will not be updated. + */ + setupTestAdapter?: boolean | undefined; + + /** + * `false` opts out of the default behavior of setting `Ember.testing` + * to `true` before all tests and back to `false` after each test will. + */ + setupEmberTesting?: boolean | undefined; + + /** + * If `false` validation of `Ember.onerror` will be disabled. + */ + setupEmberOnerrorValidation?: boolean | undefined; + + /** + * If `false` test isolation validation will be disabled. + */ + setupTestIsolationValidation?: boolean | undefined; +} + +export function start(options?: QUnitStartOptions): void; + +// SAFETY: all of the `TC extends TestContext` generics below are just wildly, +// impossibly unsafe. QUnit cannot -- ever! -- guarantee that the test context +// is properly set up in a type-safe way to match this. However, it is the only +// way to handle setting state in a TS-visible way prior to Ember RFC 0785, +// which is slooooowly rolling out across the ecosystem in conjunction with the +// `