-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: improved polyfill and ponyfill tests
- Loading branch information
Showing
22 changed files
with
162 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
.reports | ||
*.log | ||
dist | ||
test.ponyfill.js | ||
test.polyfill.js | ||
ponyfill.bundle.js | ||
polyfill.bundle.js | ||
|
||
# OSX | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/sh | ||
npx webpack --config $(dirname "$0")/webpack.config.js && | ||
npx mocha $(dirname "$0")/test.*.js | ||
npx mocha $(dirname "$0")/*.bundle.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/sh | ||
npx webpack --config $(dirname "$0")/webpack.config.js && | ||
npx mocha $(dirname "$0")/test.*.js | ||
npx mocha $(dirname "$0")/*.bundle.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<link href="../../../node_modules/mocha/mocha.css" rel="stylesheet" /> | ||
</head> | ||
|
||
<body> | ||
<div id="mocha"></div> | ||
|
||
<script src="../../../node_modules/chai/chai.js"></script> | ||
<script src="../../../node_modules/mocha/mocha.js"></script> | ||
|
||
<script src="../../setup/browser.env.js"></script> | ||
<script src="../../module-system/module.spec.js"></script> | ||
<script src="./polyfill.bundle.js"></script> | ||
|
||
<script> | ||
if (/globals=off/.test(location.search)) { | ||
describe('Browser:Polyfill:Require:Webpack', () => { | ||
addModuleSuite({ fetch, Request, Response, Headers }) | ||
addPolyfillSuite({ fetch }) | ||
}) | ||
} else { | ||
describe('Browser:Native:Require:Webpack', () => { | ||
addModuleSuite({ fetch, Request, Response, Headers }) | ||
addNativeSuite({ fetch }) | ||
}) | ||
} | ||
|
||
mocha.checkLeaks() | ||
mocha.run() | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1 @@ | ||
require('../../../polyfill') | ||
const { addModuleSuite, addPolyfillSuite, addNativeSuite } = require('../module.spec') | ||
|
||
if (/globals=off/.test(location.search)) { | ||
describe('Browser:Polyfill:Require:Webpack', () => { | ||
addModuleSuite({ fetch, Request, Response, Headers }) | ||
addPolyfillSuite({ fetch }) | ||
}) | ||
} else { | ||
describe('Browser:Native:Require:Webpack', () => { | ||
addModuleSuite({ fetch, Request, Response, Headers }) | ||
addNativeSuite({ fetch }) | ||
}) | ||
} | ||
|
||
mocha.checkLeaks() | ||
mocha.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<link href="../../../node_modules/mocha/mocha.css" rel="stylesheet" /> | ||
</head> | ||
|
||
<body> | ||
<div id="mocha"></div> | ||
|
||
<script src="../../../node_modules/chai/chai.js"></script> | ||
<script src="../../../node_modules/mocha/mocha.js"></script> | ||
|
||
<script src="../../setup/browser.env.js"></script> | ||
<script src="../../module-system/module.spec.js"></script> | ||
<script src="./ponyfill.bundle.js"></script> | ||
|
||
<script> | ||
if (/globals=off/.test(location.search)) { | ||
describe('Browser:Ponyfill:Require:Webpack', () => { | ||
addModuleSuite(namedExports) | ||
addPonyfillSuite({ ...namedExports, defaultExport }) | ||
}) | ||
} else { | ||
describe('Browser:Native:Require:Webpack', () => { | ||
addModuleSuite(namedExports) | ||
addNativeSuite({ fetch }) | ||
}) | ||
} | ||
|
||
mocha.checkLeaks() | ||
mocha.run() | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,2 @@ | ||
const defaultExport = require('../../..') | ||
const namedExports = require('../../..') | ||
const { addModuleSuite, addPonyfillSuite, addNativeSuite } = require('../module.spec') | ||
|
||
if (/globals=off/.test(location.search)) { | ||
describe('Browser:Ponyfill:Require:Webpack', () => { | ||
addModuleSuite(namedExports) | ||
addPonyfillSuite({ ...namedExports, defaultExport }) | ||
}) | ||
} else { | ||
describe('Browser:Native:Require:Webpack', () => { | ||
addModuleSuite(namedExports) | ||
addNativeSuite({ fetch }) | ||
}) | ||
} | ||
|
||
mocha.checkLeaks() | ||
mocha.run() | ||
window.defaultExport = require('../../..') | ||
window.namedExports = require('../../..') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/sh | ||
npx webpack --config $(dirname "$0")/webpack.config.js && | ||
npx mocha-headless-chrome -f $(dirname "$0")/test.polyfill.html?globals=off && | ||
npx mocha-headless-chrome -f $(dirname "$0")/test.polyfill.html?globals=on && | ||
npx mocha-headless-chrome -f $(dirname "$0")/test.ponyfill.html?globals=off && | ||
npx mocha-headless-chrome -f $(dirname "$0")/test.ponyfill.html?globals=on | ||
npx mocha-headless-chrome -f $(dirname "$0")/polyfill.html?globals=off && | ||
npx mocha-headless-chrome -f $(dirname "$0")/polyfill.html?globals=on && | ||
npx mocha-headless-chrome -f $(dirname "$0")/ponyfill.html?globals=off && | ||
npx mocha-headless-chrome -f $(dirname "$0")/ponyfill.html?globals=on |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<link href="../../../node_modules/mocha/mocha.css" rel="stylesheet" /> | ||
</head> | ||
|
||
<body> | ||
<div id="mocha"></div> | ||
|
||
<script src="../../../node_modules/chai/chai.js"></script> | ||
<script src="../../../node_modules/mocha/mocha.js"></script> | ||
|
||
<script src="../../setup/browser.env.js"></script> | ||
<script src="../../module-system/module.spec.js"></script> | ||
<script src="./polyfill.bundle.js"></script> | ||
|
||
<script> | ||
if (/globals=off/.test(location.search)) { | ||
describe('Browser:Polyfill:Import:Webpack', () => { | ||
addModuleSuite({ fetch, Request, Response, Headers }) | ||
addPolyfillSuite({ fetch }) | ||
}) | ||
} else { | ||
describe('Browser:Native:Import:Webpack', () => { | ||
addModuleSuite({ fetch, Request, Response, Headers }) | ||
addNativeSuite({ fetch }) | ||
}) | ||
} | ||
|
||
mocha.checkLeaks() | ||
mocha.run() | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1 @@ | ||
import '../../../polyfill' | ||
import { addModuleSuite, addPolyfillSuite, addNativeSuite } from '../module.spec' | ||
|
||
if (/globals=off/.test(location.search)) { | ||
describe('Browser:Polyfill:Import:Webpack', () => { | ||
addModuleSuite({ fetch, Request, Response, Headers }) | ||
addPolyfillSuite({ fetch }) | ||
}) | ||
} else { | ||
describe('Browser:Native:Import:Webpack', () => { | ||
addModuleSuite({ fetch, Request, Response, Headers }) | ||
addNativeSuite({ fetch }) | ||
}) | ||
} | ||
|
||
mocha.checkLeaks() | ||
mocha.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<link href="../../../node_modules/mocha/mocha.css" rel="stylesheet" /> | ||
</head> | ||
|
||
<body> | ||
<div id="mocha"></div> | ||
|
||
<script src="../../../node_modules/chai/chai.js"></script> | ||
<script src="../../../node_modules/mocha/mocha.js"></script> | ||
|
||
<script src="../../setup/browser.env.js"></script> | ||
<script src="../../module-system/module.spec.js"></script> | ||
<script src="./ponyfill.bundle.js"></script> | ||
|
||
<script> | ||
if (/globals=off/.test(location.search)) { | ||
describe('Browser:Ponyfill:Import:Webpack', () => { | ||
addModuleSuite(namedExports) | ||
addPonyfillSuite({ ...namedExports, defaultExport }) | ||
}) | ||
} else { | ||
describe('Browser:Native:Import:Webpack', () => { | ||
addModuleSuite(namedExports) | ||
addNativeSuite({ fetch }) | ||
}) | ||
} | ||
|
||
mocha.checkLeaks() | ||
mocha.run() | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,4 @@ | ||
import defaultExport, * as namedExports from '../../..' | ||
import { addModuleSuite, addPonyfillSuite, addNativeSuite } from '../module.spec' | ||
|
||
if (/globals=off/.test(location.search)) { | ||
describe('Browser:Ponyfill:Import:Webpack', () => { | ||
addModuleSuite(namedExports) | ||
addPonyfillSuite({ ...namedExports, defaultExport }) | ||
}) | ||
} else { | ||
describe('Browser:Native:Import:Webpack', () => { | ||
addModuleSuite(namedExports) | ||
addNativeSuite({ fetch }) | ||
}) | ||
} | ||
|
||
mocha.checkLeaks() | ||
mocha.run() | ||
window.defaultExport = defaultExport | ||
window.namedExports = namedExports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/sh | ||
npx webpack --config $(dirname "$0")/webpack.config.js && | ||
npx mocha-headless-chrome -f $(dirname "$0")/test.polyfill.html?globals=off && | ||
npx mocha-headless-chrome -f $(dirname "$0")/test.polyfill.html?globals=on && | ||
npx mocha-headless-chrome -f $(dirname "$0")/test.ponyfill.html?globals=off && | ||
npx mocha-headless-chrome -f $(dirname "$0")/test.ponyfill.html?globals=on | ||
npx mocha-headless-chrome -f $(dirname "$0")/polyfill.html?globals=off && | ||
npx mocha-headless-chrome -f $(dirname "$0")/polyfill.html?globals=on && | ||
npx mocha-headless-chrome -f $(dirname "$0")/ponyfill.html?globals=off && | ||
npx mocha-headless-chrome -f $(dirname "$0")/ponyfill.html?globals=on |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters