From 4b2aa658bb4a78449597ab739b6a301b4e31fb73 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Sat, 23 Sep 2023 17:39:21 -0400 Subject: [PATCH] V2 Conversion Remove old files and dependencies from qunit-dom Add new test index.html that demonstrates the problem in #2022 Fix exports Ah, so we do compile to ESM already We have to remove the ember-addon keyword because we don't want to provide an addon-main and then have a dependency on @embroider/addon-shim --- pnpm-lock.yaml | 283 ++++++++++++++++++++ pnpm-workspace.yaml | 1 + qunit-dom/.ember-cli | 10 - qunit-dom/.watchmanconfig | 3 - qunit-dom/ember-cli-build.js | 29 -- qunit-dom/testem.js | 18 -- test-vite-app/index.html | 19 ++ test-vite-app/package.json | 13 + test-vite-app/setup.js | 19 ++ test-vite-app/tests/my-first-native-test.js | 19 ++ test-vite-app/vite.config.js | 6 + 11 files changed, 360 insertions(+), 60 deletions(-) delete mode 100644 qunit-dom/.ember-cli delete mode 100644 qunit-dom/.watchmanconfig delete mode 100644 qunit-dom/ember-cli-build.js delete mode 100644 qunit-dom/testem.js create mode 100644 test-vite-app/index.html create mode 100644 test-vite-app/package.json create mode 100644 test-vite-app/setup.js create mode 100644 test-vite-app/tests/my-first-native-test.js create mode 100644 test-vite-app/vite.config.js diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f9bac4766..0eb8d63b8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -343,6 +343,18 @@ importers: specifier: ^5.75.0 version: 5.88.2 + test-vite-app: + devDependencies: + qunit: + specifier: ^2.19.4 + version: 2.19.4 + qunit-dom: + specifier: workspace:^ + version: link:../qunit-dom + vite: + specifier: ^4.4.9 + version: 4.4.11 + packages: /@aashutoshrathi/word-wrap@1.2.6: @@ -2330,6 +2342,204 @@ packages: - utf-8-validate dev: true + /@esbuild/android-arm64@0.18.20: + resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-arm@0.18.20: + resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-x64@0.18.20: + resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-arm64@0.18.20: + resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-x64@0.18.20: + resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-arm64@0.18.20: + resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-x64@0.18.20: + resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm64@0.18.20: + resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm@0.18.20: + resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ia32@0.18.20: + resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-loong64@0.18.20: + resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-mips64el@0.18.20: + resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ppc64@0.18.20: + resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-riscv64@0.18.20: + resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-s390x@0.18.20: + resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-x64@0.18.20: + resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/netbsd-x64@0.18.20: + resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/openbsd-x64@0.18.20: + resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/sunos-x64@0.18.20: + resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-arm64@0.18.20: + resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-ia32@0.18.20: + resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-x64@0.18.20: + resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@eslint-community/eslint-utils@4.4.0(eslint@7.32.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -8959,6 +9169,36 @@ packages: is-symbol: 1.0.4 dev: true + /esbuild@0.18.20: + resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/android-arm': 0.18.20 + '@esbuild/android-arm64': 0.18.20 + '@esbuild/android-x64': 0.18.20 + '@esbuild/darwin-arm64': 0.18.20 + '@esbuild/darwin-x64': 0.18.20 + '@esbuild/freebsd-arm64': 0.18.20 + '@esbuild/freebsd-x64': 0.18.20 + '@esbuild/linux-arm': 0.18.20 + '@esbuild/linux-arm64': 0.18.20 + '@esbuild/linux-ia32': 0.18.20 + '@esbuild/linux-loong64': 0.18.20 + '@esbuild/linux-mips64el': 0.18.20 + '@esbuild/linux-ppc64': 0.18.20 + '@esbuild/linux-riscv64': 0.18.20 + '@esbuild/linux-s390x': 0.18.20 + '@esbuild/linux-x64': 0.18.20 + '@esbuild/netbsd-x64': 0.18.20 + '@esbuild/openbsd-x64': 0.18.20 + '@esbuild/sunos-x64': 0.18.20 + '@esbuild/win32-arm64': 0.18.20 + '@esbuild/win32-ia32': 0.18.20 + '@esbuild/win32-x64': 0.18.20 + dev: true + /escalade@3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} engines: {node: '>=6'} @@ -15527,6 +15767,14 @@ packages: fsevents: 2.3.3 dev: true + /rollup@3.29.4: + resolution: {integrity: sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==} + engines: {node: '>=14.18.0', npm: '>=8.0.0'} + hasBin: true + optionalDependencies: + fsevents: 2.3.3 + dev: true + /rsvp@3.2.1: resolution: {integrity: sha512-Rf4YVNYpKjZ6ASAmibcwTNciQ5Co5Ztq6iZPEykHpkoflnD/K5ryE/rHehFsTm4NJj8nKDhbi3eKBWGogmNnkg==} dev: true @@ -17539,6 +17787,41 @@ packages: vfile-message: 3.1.4 dev: true + /vite@4.4.11: + resolution: {integrity: sha512-ksNZJlkcU9b0lBwAGZGGaZHCMqHsc8OpgtoYhsQ4/I2v5cnpmmmqe5pM4nv/4Hn6G/2GhTdj0DhZh2e+Er1q5A==} + engines: {node: ^14.18.0 || >=16.0.0} + hasBin: true + peerDependencies: + '@types/node': '>= 14' + less: '*' + lightningcss: ^1.21.0 + sass: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + dependencies: + esbuild: 0.18.20 + postcss: 8.4.29 + rollup: 3.29.4 + optionalDependencies: + fsevents: 2.3.3 + dev: true + /vm2@3.9.19: resolution: {integrity: sha512-J637XF0DHDMV57R6JyVsTak7nIL8gy5KH4r1HiwWLf/4GBbb5MKL5y7LpmF4A8E2nR6XmzpmMFQ7V7ppPTmUQg==} engines: {node: '>=6.0'} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index e48eb849a..c9b7d8f82 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,3 +1,4 @@ packages: - "qunit-dom" - "test-app" + - "test-vite-app" diff --git a/qunit-dom/.ember-cli b/qunit-dom/.ember-cli deleted file mode 100644 index 46f665ee2..000000000 --- a/qunit-dom/.ember-cli +++ /dev/null @@ -1,10 +0,0 @@ -{ - /** - 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, - "outputPath": "dist/ember" -} diff --git a/qunit-dom/.watchmanconfig b/qunit-dom/.watchmanconfig deleted file mode 100644 index e7834e3e4..000000000 --- a/qunit-dom/.watchmanconfig +++ /dev/null @@ -1,3 +0,0 @@ -{ - "ignore_dirs": ["tmp", "dist"] -} diff --git a/qunit-dom/ember-cli-build.js b/qunit-dom/ember-cli-build.js deleted file mode 100644 index 0b3c1363e..000000000 --- a/qunit-dom/ember-cli-build.js +++ /dev/null @@ -1,29 +0,0 @@ -/* eslint-env node */ -'use strict'; - -const EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); - -module.exports = function (defaults) { - let app = new EmberAddon(defaults, { - // Add options here - }); - - if (process.env.USE_EMBROIDER === 'true') { - const { Webpack } = require('@embroider/webpack'); - return require('@embroider/compat').compatBuild(app, Webpack, { - staticAddonTestSupportTrees: true, - staticAddonTrees: true, - staticHelpers: true, - staticComponents: true, - }); - } - - /* - This build file specifies the options for the dummy test app of this - addon, located in `/tests/dummy` - This build file does *not* influence how the addon or the app using it - behave. You most likely want to be modifying `./index.js` or app's build file - */ - - return app.toTree(); -}; diff --git a/qunit-dom/testem.js b/qunit-dom/testem.js deleted file mode 100644 index 80ba50e0c..000000000 --- a/qunit-dom/testem.js +++ /dev/null @@ -1,18 +0,0 @@ -/* eslint-env node */ -module.exports = { - test_page: 'tests/index.html?hidepassed', - disable_watching: true, - launch_in_ci: ['Chrome'], - launch_in_dev: ['Chrome'], - browser_args: { - Chrome: [ - // --no-sandbox is needed when running Chrome inside a container - process.env.TRAVIS ? '--no-sandbox' : null, - - '--disable-gpu', - '--headless', - '--remote-debugging-port=9222', - '--window-size=1440,900', - ].filter(Boolean), - }, -}; diff --git a/test-vite-app/index.html b/test-vite-app/index.html new file mode 100644 index 000000000..b5757d374 --- /dev/null +++ b/test-vite-app/index.html @@ -0,0 +1,19 @@ + + + + + Test Vite App + + + + + + +
+
+
+
+
+
+ + diff --git a/test-vite-app/package.json b/test-vite-app/package.json new file mode 100644 index 000000000..16d139510 --- /dev/null +++ b/test-vite-app/package.json @@ -0,0 +1,13 @@ +{ + "name": "test-vite-app", + "private": true, + "type": "module", + "scripts": { + "start": "vite" + }, + "devDependencies": { + "qunit": "^2.19.4", + "qunit-dom": "workspace:^", + "vite": "^4.4.9" + } +} diff --git a/test-vite-app/setup.js b/test-vite-app/setup.js new file mode 100644 index 000000000..3f46665f6 --- /dev/null +++ b/test-vite-app/setup.js @@ -0,0 +1,19 @@ +// QUnit's package.json needs updating, because this is silly +import 'qunit/qunit/qunit.css'; +import * as QUnit from 'qunit/qunit/qunit.js'; + +// Setup the package that this repo provides +import { setup } from 'qunit-dom'; + +QUnit.config.autostart = false; + +console.log('setting up'); +setup(QUnit.assert); + + +const modules = import.meta.glob('./tests/*', { eager: true }); + +console.log({ modules }); + +QUnit.start(); + diff --git a/test-vite-app/tests/my-first-native-test.js b/test-vite-app/tests/my-first-native-test.js new file mode 100644 index 000000000..b34bce8dc --- /dev/null +++ b/test-vite-app/tests/my-first-native-test.js @@ -0,0 +1,19 @@ +import { module, test } from 'qunit/qunit/qunit.js'; + +module('a module', function() { + test('it works', function (assert) { + assert.ok(1); + }); + + test('dom assertions work', function (assert) { + /** + * We didn't render anything into the + * test container, so we shouldn't + * expect anything to be there + */ + assert.dom().hasNoText(); + }); +}); + + + diff --git a/test-vite-app/vite.config.js b/test-vite-app/vite.config.js new file mode 100644 index 000000000..0965d1e6b --- /dev/null +++ b/test-vite-app/vite.config.js @@ -0,0 +1,6 @@ +import { defineConfig } from 'vite' + +// https://vitejs.dev/config/ +export default defineConfig({ + +})