Skip to content

Commit

Permalink
test(testem): use custom test page with latest mocha
Browse files Browse the repository at this point in the history
  • Loading branch information
char0n committed Oct 31, 2019
1 parent c814fdd commit c511d00
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 16 deletions.
20 changes: 20 additions & 0 deletions test/mocha-testem.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!doctype html>
<html>
<head>
<title>Test'em</title>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/mocha/6.2.0/mocha.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/mocha/6.2.0/mocha.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/chai/4.2.0/chai.js"></script>
<script src="/testem.js"></script>
<script>
mocha.setup('bdd');
</script>
<script src="../tmp-test-bundle.js"></script>
</head>
<body>
<div id="mocha"></div>
<script>
mocha.run();
</script>
</body>
</html>
2 changes: 1 addition & 1 deletion test/padCharsEnd.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('padCharsEnd', function() {
});

context('padCharsEndStrInvoker', function() {
beforeEach(function() {
before(function() {
if (RA.isNotFunction(String.prototype.padEnd)) {
this.skip();
}
Expand Down
2 changes: 1 addition & 1 deletion test/repeatStr.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('repeatStr', function() {
});

context('repeatStrInvoker', function() {
beforeEach(function() {
before(function() {
if (RA.isNotFunction(String.prototype.repeat)) {
this.skip();
}
Expand Down
2 changes: 1 addition & 1 deletion test/replaceAll.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('replaceAll', function() {
});

context('replaceAllInvoker', function() {
beforeEach(function() {
before(function() {
if (RA.isNotFunction(String.prototype.replaceAll)) {
this.skip();
}
Expand Down
2 changes: 1 addition & 1 deletion test/sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ describe('sign', function() {
});

context('signPolyfill', function() {
beforeEach(function() {
before(function() {
if (RA.isNotFunction(Math.sign)) {
this.skip();
}
Expand Down
2 changes: 1 addition & 1 deletion test/trimEnd.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('trimEnd', function() {
});

context('trimEndInvoker', function() {
beforeEach(function() {
before(function() {
if (RA.isNotFunction(String.prototype.trimEnd)) {
this.skip();
}
Expand Down
2 changes: 1 addition & 1 deletion test/trimStart.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('trimStart', function() {
});

context('trimStartInvoker', function() {
beforeEach(function() {
before(function() {
if (RA.isNotFunction(String.prototype.trimStart)) {
this.skip();
}
Expand Down
2 changes: 1 addition & 1 deletion test/trunc.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe('trunc', function() {
});

context('truncPolyfill', function() {
beforeEach(function() {
before(function() {
if (RA.isNotFunction(Math.trunc)) {
this.skip();
}
Expand Down
10 changes: 1 addition & 9 deletions testem.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
{
"framework": "mocha",
"cwd": ".",
"src_files": [
"src/*.js",
"test/*.js"
],
"serve_files": [
"tmp-test-bundle.js"
],
"test_page": "./test/mocha-testem.mustache",
"before_tests": "npm run test:bundle-create",
"after_tests": "npm run test:bundle-clean"
}

0 comments on commit c511d00

Please sign in to comment.