Skip to content

Commit

Permalink
add symbol polyfill to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Garrett committed Feb 6, 2019
1 parent df39f05 commit 6f95d66
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 0 deletions.
26 changes: 26 additions & 0 deletions broccoli/test-polyfills.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const Rollup = require('broccoli-rollup');
const writeFile = require('broccoli-file-creator');
const resolve = require('rollup-plugin-node-resolve');
const commonjs = require('rollup-plugin-commonjs');

module.exports = function polyfills() {
let polyfillEntry = writeFile(
'polyfill.js',
`
require("core-js/modules/es6.symbol");
require("core-js/modules/es6.object.to-string");
`
);

return new Rollup(polyfillEntry, {
rollup: {
input: 'polyfill.js',
output: {
file: 'polyfill.js',
name: 'polyfill',
format: 'iife',
},
plugins: [resolve(), commonjs()],
},
});
};
2 changes: 2 additions & 0 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const bootstrapModule = require('./broccoli/bootstrap-modules');
const concatBundle = require('./broccoli/concat-bundle');
const concat = require('broccoli-concat');
const testIndexHTML = require('./broccoli/test-index-html');
const testPolyfills = require('./broccoli/test-polyfills');
const toES5 = require('./broccoli/to-es5');
const toNamedAMD = require('./broccoli/to-named-amd');
const stripForProd = require('./broccoli/strip-for-prod');
Expand Down Expand Up @@ -141,6 +142,7 @@ module.exports = function() {
nodeTests(),

// test harness
testPolyfills(),
testIndexHTML(),
jquery(),
qunit(),
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
"broccoli-typescript-compiler": "^4.0.1",
"broccoli-uglify-sourcemap": "^2.2.0",
"common-tags": "^1.8.0",
"core-js": "^2.6.3",
"dag-map": "^2.0.2",
"ember-cli": "^3.7.1",
"ember-cli-blueprint-test-helpers": "^0.19.2",
Expand Down Expand Up @@ -150,6 +151,8 @@
"prettier": "1.16.4",
"puppeteer": "^1.12.1",
"qunit": "^2.9.1",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-node-resolve": "^4.0.0",
"route-recognizer": "^0.3.4",
"router_js": "^6.2.3",
"rsvp": "^4.8.4",
Expand Down
1 change: 1 addition & 0 deletions tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
display: none;
}
</style>
<script src="/polyfill.js"></script>
<script src="../qunit/qunit.js"></script>
<script src="/testem.js"></script>

Expand Down
59 changes: 59 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1995,6 +1995,11 @@ builtin-modules@^1.0.0, builtin-modules@^1.1.1:
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=

builtin-modules@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.0.0.tgz#1e587d44b006620d90286cc7a9238bbc6129cab1"
integrity sha512-hMIeU4K2ilbXV6Uv93ZZ0Avg/M91RaKXucQ+4me2Do1txxBDyDZWCBa5bJSLqoNTRpXTLwEzIk1KmloenDDjhg==

builtins@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88"
Expand Down Expand Up @@ -2532,6 +2537,11 @@ core-js@^2.4.0, core-js@^2.5.7:
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.0.tgz#1e30793e9ee5782b307e37ffa22da0eacddd84d4"
integrity sha512-kLRC6ncVpuEW/1kwrOXYX6KQASCVtrh1gQr/UiaVgFlf9WE5Vp+lNe5+h3LuMr5PAucWnnEXwH0nQHRH/gpGtw==

core-js@^2.6.3:
version "2.6.3"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.3.tgz#4b70938bdffdaf64931e66e2db158f0892289c49"
integrity sha512-l00tmFFZOBHtYhN4Cz7k32VM7vTn3rE2ANjQDxdEN6zmXZ/xq1jQuutnmHvMG1ZJ7xd72+TA5YpUK8wz3rWsfQ==

core-object@^3.1.5:
version "3.1.5"
resolved "https://registry.yarnpkg.com/core-object/-/core-object-3.1.5.tgz#fa627b87502adc98045e44678e9a8ec3b9c0d2a9"
Expand Down Expand Up @@ -3451,6 +3461,11 @@ estree-walker@^0.3.0:
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.3.1.tgz#e6b1a51cf7292524e7237c312e5fe6660c1ce1aa"
integrity sha1-5rGlHPcpJSTnI3wxLl/mZgwc4ao=

estree-walker@^0.5.2:
version "0.5.2"
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.5.2.tgz#d3850be7529c9580d815600b53126515e146dd39"
integrity sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig==

esutils@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
Expand Down Expand Up @@ -4868,6 +4883,11 @@ is-glob@^3.1.0:
dependencies:
is-extglob "^2.1.0"

is-module@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591"
integrity sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=

is-number@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f"
Expand Down Expand Up @@ -5764,6 +5784,13 @@ magic-string@^0.24.0:
dependencies:
sourcemap-codec "^1.4.1"

magic-string@^0.25.1:
version "0.25.2"
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.2.tgz#139c3a729515ec55e96e69e82a11fe890a293ad9"
integrity sha512-iLs9mPjh9IuTtRsqqhNGYcZXGei0Nh/A4xirrsqW7c+QhKVFL2vm7U09ru6cHRD22azaP/wMDgI+HCqbETMTtg==
dependencies:
sourcemap-codec "^1.4.4"

make-dir@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.1.0.tgz#19b4369fe48c116f53c2af95ad102c0e39e85d51"
Expand Down Expand Up @@ -7297,6 +7324,25 @@ rimraf@~2.5.2:
dependencies:
glob "^7.0.5"

rollup-plugin-commonjs@^9.2.0:
version "9.2.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-commonjs/-/rollup-plugin-commonjs-9.2.0.tgz#4604e25069e0c78a09e08faa95dc32dec27f7c89"
integrity sha512-0RM5U4Vd6iHjL6rLvr3lKBwnPsaVml+qxOGaaNUWN1lSq6S33KhITOfHmvxV3z2vy9Mk4t0g4rNlVaJJsNQPWA==
dependencies:
estree-walker "^0.5.2"
magic-string "^0.25.1"
resolve "^1.8.1"
rollup-pluginutils "^2.3.3"

rollup-plugin-node-resolve@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-4.0.0.tgz#9bc6b8205e9936cc0e26bba2415f1ecf1e64d9b2"
integrity sha512-7Ni+/M5RPSUBfUaP9alwYQiIKnKeXCOHiqBpKUl9kwp3jX5ZJtgXAait1cne6pGEVUUztPD6skIKH9Kq9sNtfw==
dependencies:
builtin-modules "^3.0.0"
is-module "^1.0.0"
resolve "^1.8.1"

rollup-pluginutils@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.0.1.tgz#7ec95b3573f6543a46a6461bd9a7c544525d0fc0"
Expand All @@ -7305,6 +7351,14 @@ rollup-pluginutils@^2.0.1:
estree-walker "^0.3.0"
micromatch "^2.3.11"

rollup-pluginutils@^2.3.3:
version "2.3.3"
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.3.3.tgz#3aad9b1eb3e7fe8262820818840bf091e5ae6794"
integrity sha512-2XZwja7b6P5q4RZ5FhyX1+f46xi1Z3qBKigLRZ6VTZjwbN0K1IFGMlwm06Uu0Emcre2Z63l77nq/pzn+KxIEoA==
dependencies:
estree-walker "^0.5.2"
micromatch "^2.3.11"

rollup@^0.57.1:
version "0.57.1"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.57.1.tgz#0bb28be6151d253f67cf4a00fea48fb823c74027"
Expand Down Expand Up @@ -7741,6 +7795,11 @@ sourcemap-codec@^1.4.1:
resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.1.tgz#c8fd92d91889e902a07aee392bdd2c5863958ba2"
integrity sha512-hX1eNBNuilj8yfFnECh0DzLgwKpBLMIvmhgEhixXNui8lMLBInTI8Kyxt++RwJnMNu7cAUo635L2+N1TxMJCzA==

sourcemap-codec@^1.4.4:
version "1.4.4"
resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.4.tgz#c63ea927c029dd6bd9a2b7fa03b3fec02ad56e9f"
integrity sha512-CYAPYdBu34781kLHkaW3m6b/uUSyMOC2R61gcYMWooeuaGtjof86ZA/8T+qVPPt7np1085CR9hmMGrySwEc8Xg==

sourcemap-validator@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/sourcemap-validator/-/sourcemap-validator-1.1.0.tgz#00454547d1682186e1498a7208e022e8dfa8738f"
Expand Down

0 comments on commit 6f95d66

Please sign in to comment.