-
-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: added browser example * formatting * fix: remove unnecessary script * chore: delete package-lock.json
- Loading branch information
1 parent
161148e
commit 1fd24ca
Showing
4 changed files
with
47 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Browser Example | ||
|
||
See full documentation about [running Mocha in the browser](https://mochajs.org/#running-mocha-in-the-browser). | ||
|
||
After `npm install`, open `index.html` in a browser. |
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,24 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Mocha Tests</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="stylesheet" href="node_modules/mocha/mocha.css" /> | ||
</head> | ||
<body> | ||
<div id="mocha"></div> | ||
|
||
<script src="node_modules/chai/chai.js"></script> | ||
<script src="node_modules/mocha/mocha.js"></script> | ||
|
||
<script class="mocha-init"> | ||
mocha.setup("bdd"); | ||
mocha.checkLeaks(); | ||
</script> | ||
<script src="test.example.js"></script> | ||
<script class="mocha-exec"> | ||
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "example-browser", | ||
"version": "1.0.0", | ||
"description": "Browser example", | ||
"engines": { | ||
"node": ">=10.0.0" | ||
}, | ||
"license": "ISC", | ||
"devDependencies": { | ||
"chai": "^4.4.1", | ||
"mocha": "latest" | ||
} | ||
} |
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,5 @@ | ||
describe("example", () => { | ||
it("2 + 2", () => { | ||
chai.expect(2 + 2).to.be.eql(4); | ||
}); | ||
}); |