Skip to content

Commit

Permalink
fixed IE < 11 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Giammarchi committed Dec 18, 2018
1 parent f2bdf74 commit 98693d0
Show file tree
Hide file tree
Showing 4 changed files with 2,926 additions and 1,322 deletions.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
],
"ie": [
[
"babel ./test/test.js --out-dir ./test/ie --plugins=$(",
"node -e 'console.log([\"transform-es2015-classes\", \"transform-es2015-template-literals\"].concat(require(\"./babel-plugins.json\")).join(\",\")",
")')"
"rollup --config rollup.ie.js"
]
],
"umd": [
Expand Down Expand Up @@ -61,6 +59,7 @@
"$ bundle.min",
"$ bundle.umd",
"$ bundle.esm",
"$ bundle.ie",
"$ test",
"$ size"
],
Expand Down
16 changes: 16 additions & 0 deletions rollup.ie.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import resolve from 'rollup-plugin-node-resolve';
import babel from 'rollup-plugin-babel';

export default {
input: 'test/test.js',
plugins: [
resolve({module: true}),
babel({presets: ["@babel/preset-env"]})
],
context: 'null',
moduleContext: 'null',
output: {
file: 'test/ie/test/test.js',
format: 'iife'
}
};
5 changes: 4 additions & 1 deletion test/ie/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@
<!--[if lte IE 9]><script>(function(f){window.setTimeout=f(window.setTimeout);window.setInterval=f(window.setInterval)})(function(f){return function(c,t){var a=[].slice.call(arguments,2);return f(function(){c.apply(this,a)},t)}});</script><![endif]-->
<!--[if lt IE 11]><script>Object.freeze=Object</script><![endif]-->
<script>
this.WeakMap||(Object.freeze=Object);
</script>
<script>
Function.bind||document.write([
'<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-shim.min.js"><', '/script>',
'<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-sham.min.js"><', '/script>'
].join(''))
</script>
<script>window.module = {};</script>
<script>window.Promise||document.write('<script src="https://unpkg.com/es6-promise@4.1.1"><'+'/script>')</script>
<script>window.Promise||document.write('<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-promise/4.1.1/es6-promise.auto.min.js"><'+'/script>')</script>
</head>
<body>
<h1>results in console</h1>
Expand Down
Loading

0 comments on commit 98693d0

Please sign in to comment.