Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable embroider testing #34, #33, #72 #93

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
branches:
- main
- master
schedule:
- cron: '0 3 * * 0' # every Sunday at 3am

jobs:
lint:
Expand Down Expand Up @@ -51,6 +53,7 @@ jobs:

test:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v2
Expand All @@ -75,6 +78,7 @@ jobs:
ember-try:
runs-on: ubuntu-latest
needs: ['lint', 'test']
timeout-minutes: 10
strategy:
matrix:
ember-try-scenario:
Expand All @@ -83,6 +87,8 @@ jobs:
- ember-release
- ember-beta
- ember-canary
- embroider-safe
- embroider-optimized

steps:
- uses: actions/checkout@v2
Expand Down
6 changes: 3 additions & 3 deletions config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const getChannelURL = require('ember-source-channel-url');
// const { embroiderSafe, embroiderOptimized } = require('@embroider/test-setup');
const { embroiderSafe, embroiderOptimized } = require('@embroider/test-setup');

module.exports = async function () {
return {
Expand Down Expand Up @@ -47,8 +47,8 @@ module.exports = async function () {
},
},
},
// embroiderSafe(), // FIXME: https://github.com/GavinJoyce/ember-headlessui/issues/34
// embroiderOptimized(),
embroiderSafe(),
embroiderOptimized(),
],
};
};
21 changes: 13 additions & 8 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@ const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');

module.exports = function (defaults) {
let app = new EmberAddon(defaults, {
autoImport: {
webpack: {
node: {
// Required to import `testdouble` in tests
global: true,
},
},
'ember-test-selectors': {
patchClassicComponent: false,
},

postcssOptions: {
Expand All @@ -31,5 +26,15 @@ module.exports = function (defaults) {

const { maybeEmbroider } = require('@embroider/test-setup');

return maybeEmbroider(app);
return maybeEmbroider(app, {
packageRules: [
{
package: 'dummy',
components: {
'{{debug}}': { safeToIgnore: true },
'{{link-to}}': { safeToIgnore: true },
},
},
],
});
};
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@
"broccoli-asset-rev": "^3.0.0",
"dotenv-cli": "^4.0.0",
"ember-cli": "~3.28.4",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-deprecation-workflow": "^2.0.0",
"ember-cli-inject-live-reload": "^2.1.0",
"ember-cli-postcss": "^7.0.2",
"ember-cli-sri": "^2.1.1",
Expand Down Expand Up @@ -127,7 +125,7 @@
"testdouble": "^3.16.1",
"testdouble-qunit": "^3.0.0",
"typescript": "^4.4.3",
"webpack": "^5.64.1"
"webpack": "^5.65.0"
},
"resolutions": {
"@embroider/core": "^0.43.5",
Expand Down
2 changes: 1 addition & 1 deletion tests/assertions/testdouble.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as QUnit from 'qunit';

import td from 'testdouble';
import * as td from 'testdouble';
import installVerifyAssertion from 'testdouble-qunit';

installVerifyAssertion(QUnit, td);
7 changes: 7 additions & 0 deletions tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@

{{content-for "head-footer"}}
{{content-for "test-head-footer"}}

<script>
// testdouble support
// testdouble doesn't natively support the browser as it assumes
// that a `global` identifier will be available, but that is not the case for browsers
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reported this here: testdouble/testdouble.js#438
and it seemed there was 0 interest in resolving... :-\

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also opened a new issue: testdouble/testdouble.js#471

to see what they feel like doing about it 🤷

Copy link
Collaborator

@alexlafroscia alexlafroscia Oct 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this better than just configuring ember-auto-import to polyfill global as it did before? Did that configuration need to change to support Embroider?

window.global = globalThis;
</script>
</head>
<body>
{{content-for "body"}}
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/components/transition-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { setupRenderingTest } from 'ember-qunit';

import { ARG_SHOW_MISSING_ERROR_MESSAGE } from 'ember-headlessui/components/transition';
import { PARENT_MISSING_ERROR_MESSAGE } from 'ember-headlessui/components/transition/child';
import td from 'testdouble';
import * as td from 'testdouble';

module('Integration | Component | transition', function (hooks) {
setupRenderingTest(hooks);
Expand Down
57 changes: 14 additions & 43 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3708,7 +3708,7 @@ broccoli-plugin@^2.1.0:
rimraf "^2.3.4"
symlink-or-copy "^1.1.8"

broccoli-plugin@^4.0.0, broccoli-plugin@^4.0.2, broccoli-plugin@^4.0.3, broccoli-plugin@^4.0.5, broccoli-plugin@^4.0.7:
broccoli-plugin@^4.0.0, broccoli-plugin@^4.0.2, broccoli-plugin@^4.0.3, broccoli-plugin@^4.0.7:
version "4.0.7"
resolved "https://registry.yarnpkg.com/broccoli-plugin/-/broccoli-plugin-4.0.7.tgz#dd176a85efe915ed557d913744b181abe05047db"
integrity sha512-a4zUsWtA1uns1K7p9rExYVYG99rdKeGRymW0qOCNkvDPHQxVi3yVyJHhQbM3EZwdt2E0mnhr5e0c/bPpJ7p3Wg==
Expand Down Expand Up @@ -4159,7 +4159,7 @@ chalk@^1.0.0, chalk@^1.1.3:
strip-ansi "^3.0.0"
supports-color "^2.0.0"

chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.4.1, chalk@^2.4.2:
chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.4.1, chalk@^2.4.2:
version "2.4.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
Expand Down Expand Up @@ -5333,33 +5333,12 @@ ember-cli-babel@^7.0.0, ember-cli-babel@^7.1.0, ember-cli-babel@^7.10.0, ember-c
rimraf "^3.0.1"
semver "^5.5.0"

ember-cli-dependency-checker@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/ember-cli-dependency-checker/-/ember-cli-dependency-checker-3.2.0.tgz#9202ad9e14d6fda33cffc22a11c343c2a8885330"
integrity sha512-dkSmcJ/jY/2ms/S6ph2jXSfOW5VfOpLfg5DFEbra0SaMNgYkNDFF1o0U4OdTsG37L5h/AXWNuVtnOa4TMabz9Q==
dependencies:
chalk "^2.3.0"
find-yarn-workspace-root "^1.1.0"
is-git-url "^1.0.0"
resolve "^1.5.0"
semver "^5.3.0"

ember-cli-deprecation-workflow@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/ember-cli-deprecation-workflow/-/ember-cli-deprecation-workflow-2.1.0.tgz#f0d38ece7ac0ab7b3f83790a3a092e3472f58cff"
integrity sha512-Ay9P9iKMJdY4Gq5XPowh3HqqeAzLfwBRj1oB1ZKkDW1fryZQWBN4pZuRnjnB+3VWZjBnZif5e7Pacc7YNW9hWg==
dependencies:
broccoli-funnel "^3.0.3"
broccoli-merge-trees "^4.2.0"
broccoli-plugin "^4.0.5"
ember-cli-htmlbars "^5.3.2"

ember-cli-get-component-path-option@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/ember-cli-get-component-path-option/-/ember-cli-get-component-path-option-1.0.0.tgz#0d7b595559e2f9050abed804f1d8eff1b08bc771"
integrity sha1-DXtZVVni+QUKvtgE8djv8bCLx3E=

ember-cli-htmlbars@^5.1.0, ember-cli-htmlbars@^5.3.1, ember-cli-htmlbars@^5.3.2, ember-cli-htmlbars@^5.7.1:
ember-cli-htmlbars@^5.1.0, ember-cli-htmlbars@^5.3.1, ember-cli-htmlbars@^5.7.1:
version "5.7.1"
resolved "https://registry.yarnpkg.com/ember-cli-htmlbars/-/ember-cli-htmlbars-5.7.1.tgz#eb5b88c7d9083bc27665fb5447a9b7503b32ce4f"
integrity sha512-9laCgL4tSy48orNoQgQKEHp93MaqAs9ZOl7or5q+8iyGGJHW6sVXIYrVv5/5O9HfV6Ts8/pW1rSoaeKyLUE+oA==
Expand Down Expand Up @@ -5938,7 +5917,7 @@ ember-template-recast@^5.0.3:

ember-test-selectors@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/ember-test-selectors/-/ember-test-selectors-6.0.0.tgz#ba9bb19550d9dec6e4037d86d2b13c2cfd329341"
resolved "https://registry.npmjs.org/ember-test-selectors/-/ember-test-selectors-6.0.0.tgz#ba9bb19550d9dec6e4037d86d2b13c2cfd329341"
integrity sha512-PgYcI9PeNvtKaF0QncxfbS68olMYM1idwuI8v/WxsjOGqUx5bmsu6V17vy/d9hX4mwmjgsBhEghrVasGSuaIgw==
dependencies:
calculate-cache-key-for-tree "^2.0.0"
Expand Down Expand Up @@ -6906,14 +6885,6 @@ find-up@^5.0.0:
locate-path "^6.0.0"
path-exists "^4.0.0"

find-yarn-workspace-root@^1.1.0:
version "1.2.1"
resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-1.2.1.tgz#40eb8e6e7c2502ddfaa2577c176f221422f860db"
integrity sha512-dVtfb0WuQG+8Ag2uWkbG79hOUzEsRrhBzgfn86g2sJPkzmcpGdghbNTfUKGTxymFrY/tLIodDzLoW9nOJ4FY8Q==
dependencies:
fs-extra "^4.0.3"
micromatch "^3.1.4"

find-yarn-workspace-root@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz#f47fb8d239c900eb78179aa81b66673eac88f7bd"
Expand Down Expand Up @@ -7087,7 +7058,7 @@ fs-extra@^10.0.0:
jsonfile "^6.0.1"
universalify "^2.0.0"

fs-extra@^4.0.2, fs-extra@^4.0.3:
fs-extra@^4.0.2:
version "4.0.3"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94"
integrity sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==
Expand Down Expand Up @@ -13295,10 +13266,10 @@ watchpack@^1.7.4:
chokidar "^3.4.1"
watchpack-chokidar2 "^2.0.1"

watchpack@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.2.0.tgz#47d78f5415fe550ecd740f99fe2882323a58b1ce"
integrity sha512-up4YAn/XHgZHIxFBVCdlMiWDj6WaLKpwVeGQk2I5thdYxF/KmF0aaz6TfJZ/hfl1h/XlcDr7k1KH7ThDagpFaA==
watchpack@^2.3.1:
version "2.3.1"
resolved "https://registry.npmjs.org/watchpack/-/watchpack-2.3.1.tgz#4200d9447b401156eeca7767ee610f8809bc9d25"
integrity sha512-x0t0JuydIo8qCNctdDrn1OzH/qDzk2+rdCOC3YzumZ42fiMqmQ7T3xQurykYMhYfHaPHTp4ZxAx2NfUo1K6QaA==
dependencies:
glob-to-regexp "^0.4.1"
graceful-fs "^4.1.2"
Expand Down Expand Up @@ -13367,10 +13338,10 @@ webpack@^4.43.0:
watchpack "^1.7.4"
webpack-sources "^1.4.1"

webpack@^5.64.1:
version "5.64.1"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.64.1.tgz#fd59840c16f04fe315f2b2598a85026f12dfa1bb"
integrity sha512-b4FHmRgaaAjP+aVOVz41a9Qa5SmkUPQ+u8FntTQ1roPHahSComB6rXnLwc976VhUY4CqTaLu5mCswuHiNhOfVw==
webpack@^5.65.0:
version "5.65.0"
resolved "https://registry.npmjs.org/webpack/-/webpack-5.65.0.tgz#ed2891d9145ba1f0d318e4ea4f89c3fa18e6f9be"
integrity sha512-Q5or2o6EKs7+oKmJo7LaqZaMOlDWQse9Tm5l1WAfU/ujLGN5Pb0SqGeVkN/4bpPmEqEP5RnVhiqsOtWtUVwGRw==
dependencies:
"@types/eslint-scope" "^3.7.0"
"@types/estree" "^0.0.50"
Expand All @@ -13394,7 +13365,7 @@ webpack@^5.64.1:
schema-utils "^3.1.0"
tapable "^2.1.1"
terser-webpack-plugin "^5.1.3"
watchpack "^2.2.0"
watchpack "^2.3.1"
webpack-sources "^3.2.2"

websocket-driver@>=0.5.1:
Expand Down