forked from gruntjs/grunt-contrib-qunit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Add support for code coverage collection
- Loading branch information
Showing
8 changed files
with
105 additions
and
7 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
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,15 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Test Suite</title> | ||
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css" media="screen"> | ||
</head> | ||
<body> | ||
<div id="qunit"></div> | ||
<div id="qunit-fixture"></div> | ||
<script src="../node_modules/qunit/qunit/qunit.js"></script> | ||
<script src="qunit_cover_src.js"></script> | ||
<script src="qunit_cover_test.js"></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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Test Suite</title> | ||
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css" media="screen"> | ||
</head> | ||
<body> | ||
<div id="qunit"></div> | ||
<div id="qunit-fixture"></div> | ||
<script src="../node_modules/qunit/qunit/qunit.js"></script> | ||
<script src="qunit_cover_src.js"></script> | ||
<script src="qunit_cover_test2.js"></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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
class Foo { | ||
constructor(id) { | ||
this.id = id; | ||
this.position = 0; | ||
} | ||
reset() { | ||
// Untested | ||
this.position = 0; | ||
} | ||
walk() { | ||
this.position += 1; | ||
} | ||
run() { | ||
this.position += 10; | ||
} | ||
} | ||
|
||
globalThis.MyApp = { | ||
makeFoo(id) { | ||
return new Foo(id); | ||
} | ||
}; |
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 @@ | ||
/* global MyApp */ | ||
|
||
QUnit.test('MyApp.run', function(assert) { | ||
var foo = MyApp.makeFoo(42); | ||
assert.strictEqual(foo.position, 0); | ||
|
||
foo.run(); | ||
assert.strictEqual(foo.position, 10); | ||
}); |
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 @@ | ||
/* global MyApp */ | ||
|
||
QUnit.test('MyApp.walk', function(assert) { | ||
var foo = MyApp.makeFoo(42); | ||
assert.strictEqual(foo.position, 0); | ||
|
||
foo.walk(); | ||
assert.strictEqual(foo.position, 1); | ||
}); |