Skip to content

Commit

Permalink
Add polyfills to testem and karma tests to fix IE tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kimmobrunfeldt committed May 11, 2020
1 parent 8f8059b commit bdea318
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ See complete examples in [full examples](#full-examples) section.
You can include ES6 polyfills by adding to your index.html:

```
<script crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js"></script>
<script crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
```

See https://github.com/jeremyckahn/shifty#ie-compatibility and https://polyfill.io/v3/url-builder/.
Expand Down
4 changes: 2 additions & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ var customLaunchers = require('./saucelabs-browsers');

module.exports = function(config) {
config.set({
frameworks: ['mocha', 'browserify'],

frameworks: ['polyfill', 'mocha', 'browserify'],
polyfill: ['es6'],
files: [
'test/*.js'
],
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"karma": "^2.0.2",
"karma-browserify": "^5.2.0",
"karma-mocha": "^1.3.0",
"karma-polyfill": "^1.1.0",
"karma-sauce-launcher": "^1.2.0",
"lodash": "^2.4.1",
"mocha": "^2.0.1",
Expand Down
1 change: 1 addition & 0 deletions test/testem.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ <h1>Test div</h1>
<div id="container"></div>
</div>

<script crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script src="/node_modules/mocha/mocha.js"></script>
<script>mocha.setup('bdd')</script>
<script src="/testem.js"></script>
Expand Down

0 comments on commit bdea318

Please sign in to comment.