-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the expectThat.mocha NPM package and an example for use.
- Loading branch information
Showing
18 changed files
with
592 additions
and
21 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
NuGet/ExpectThat.Mocha/Content/Scripts/Specs/example.spec.coffee.pp
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,31 @@ | ||
describe "Example Mocha Specifications", -> | ||
foo = "bar" | ||
describe "When testing should equal", -> | ||
expectThat -> foo.should equal "bar" | ||
describe "When testing shouldnt equal", -> | ||
expectThat -> foo.shouldnt equal "baz" | ||
describe "When testing for true", -> | ||
expectThat -> (foo is "bar").should be true | ||
expectThat -> (foo is "baz").shouldnt be true | ||
describe "When testing for false", -> | ||
expectThat -> (foo is "baz").should be false | ||
expectThat -> (foo is "bar").shouldnt be false | ||
describe "When testing to and be", -> | ||
expectThat -> foo.should be equal to "bar" | ||
expectThat -> foo.shouldnt be equal to "bah" | ||
describe "When testing for null or undefined", -> | ||
testNull = null | ||
testUndefined = undefined | ||
expectThat -> (testNull is null).should be true | ||
expectThat -> (testNull isnt null).shouldnt be true | ||
expectThat -> (testUndefined is undefined).should be true | ||
expectThat -> (testUndefined is undefined).shouldnt be false | ||
describe "When testing for throw", -> | ||
expectThat -> (-> throw "test exception").should throwException | ||
expectThat -> (-> throw "test exception").should throwException "test exception" | ||
describe "When testing for greater than", -> | ||
expectThat -> 10.should be greaterThan 9 | ||
expectThat -> 9.1.shouldnt be greaterThan 10 | ||
describe "When testing for less than", -> | ||
expectThat -> 10.should be lessThan 11 | ||
expectThat -> 10.1.shouldnt be lessThan 10 |
22 changes: 22 additions & 0 deletions
22
NuGet/ExpectThat.Mocha/Content/Scripts/Specs/index.html.pp
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 @@ | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Mocha Tests</title> | ||
<link rel="stylesheet" href="https://raw.github.com/visionmedia/mocha/master/mocha.css" /> | ||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | ||
<script src="https://raw.github.com/visionmedia/mocha/master/mocha.js"></script> | ||
<script type="text/javascript" src="../../lib/expectThat.mocha.js"></script> | ||
<script>mocha.setup('bdd')</script> | ||
<script src="./min/example.spec.js"></script> | ||
<script> | ||
$(function () { | ||
mocha | ||
.run() | ||
.globals(['foo', 'bar']) // acceptable globals | ||
}) | ||
</script> | ||
</head> | ||
<body> | ||
<div id="mocha"></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,18 @@ | ||
<?xml version="1.0"?> | ||
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | ||
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> | ||
<id>ExpectThat.Mocha</id> | ||
<version>0.2.2.2</version> | ||
<authors>Daniel Mohl</authors> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<description>ExpectThat for Mocha is an expressive, self-documenting assertion library for CoffeScript/JavaScript.</description> | ||
<summary>ExpectThat for Mocha is an expressive, self-documenting assertion library for CoffeScript/JavaScript.</summary> | ||
<language>en-US</language> | ||
<projectUrl>https://github.com/dmohl/expectThat</projectUrl> | ||
<licenseUrl>https://github.com/dmohl/expectThat/blob/master/MIT.License</licenseUrl> | ||
<tags>JavaScript CoffeeScript ExpectThat Mocha</tags> | ||
</metadata> | ||
<files> | ||
<file src="Content\Scripts\Specs\*.pp" target="content\Scripts\Specs"/> | ||
</files> | ||
</package> |
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,4 @@ | ||
c:\nuget\nuget.exe pack .\ExpectThat.Mocha.nuspec | ||
md c:\nuget\ExpectThat.Mocha\ | ||
copy .\*.nupkg c:\nuget\ExpectThat.Mocha\ /Y | ||
pause |
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
230 changes: 230 additions & 0 deletions
230
example/mocha-node/node_modules/expectThat.mocha/lib/expectThat.mocha.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file added
BIN
+1.32 KB
example/mocha-node/node_modules/expectThat.mocha/lib/expectThat.mocha.min.gz.js
Binary file not shown.
1 change: 1 addition & 0 deletions
1
example/mocha-node/node_modules/expectThat.mocha/lib/expectThat.mocha.min.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
example/mocha-node/node_modules/expectThat.mocha/lib/main.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
example/mocha-node/node_modules/expectThat.mocha/package.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.