-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce support for multiple test pages
- Loading branch information
Trent Willis
committed
Mar 2, 2016
1 parent
f22cd07
commit b20b971
Showing
24 changed files
with
283 additions
and
43 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
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 @@ | ||
node_modules |
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,9 @@ | ||
## Setup | ||
|
||
First install dependencies | ||
|
||
npm install | ||
|
||
Then, just run tests | ||
|
||
npm test |
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,3 @@ | ||
function hello(name){ | ||
return "hello " + (name || 'world'); | ||
} |
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,13 @@ | ||
{ | ||
"devDependencies": { | ||
"qunitjs": "^1.20.0" | ||
}, | ||
"scripts": { | ||
"test": "node ../../testem.js ci -P 10" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/testem/testem.git" | ||
}, | ||
"license": "MIT" | ||
} |
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,18 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>Test'em</title> | ||
<link rel="stylesheet" href="/node_modules/qunitjs/qunit/qunit.css"> | ||
<script src="/testem.js"></script> | ||
<script src="/node_modules/qunitjs/qunit/qunit.js"></script> | ||
<script src="hello.js"></script> | ||
<script src="tests.js"></script> | ||
<script> | ||
Testem.hookIntoTestFramework(); | ||
</script> | ||
</head> | ||
<body> | ||
<div id="qunit"></div> | ||
<div id="qunit-fixture"></div> | ||
</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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"framework": "qunit", | ||
"test_page": [ | ||
"test.html?batch=1", | ||
"test.html?batch=2" | ||
], | ||
"src_files": [ | ||
"*.js" | ||
], | ||
"parallel": "-1" | ||
} |
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,11 @@ | ||
for (var i = 0; i < 200; i++) { | ||
if (window.location.search === '?batch=1') { | ||
QUnit.test('says hello world', function(assert){ | ||
assert.equal(hello(), 'hello world', 'should equal hello world'); | ||
}); | ||
} else { | ||
QUnit.test('says hello to person', function(assert){ | ||
assert.equal(hello('Bob'), 'hello Bob', 'should equal hello Bob'); | ||
}); | ||
} | ||
} |
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
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
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,17 @@ | ||
var Launcher = require('./launcher'); | ||
var extend = require('lodash').extend; | ||
|
||
function LauncherFactory(name, settings, config) { | ||
this.name = name; | ||
this.config = config; | ||
this.settings = settings; | ||
} | ||
|
||
LauncherFactory.prototype = { | ||
create: function(options) { | ||
var settings = extend({}, this.settings, options); | ||
return new Launcher(this.name, settings, this.config); | ||
} | ||
}; | ||
|
||
module.exports = LauncherFactory; |
Oops, something went wrong.