Skip to content

Commit

Permalink
Add demo
Browse files Browse the repository at this point in the history
  • Loading branch information
mantoni committed Aug 9, 2018
1 parent a24dc37 commit ce794ee
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
20 changes: 20 additions & 0 deletions demo/diff.test.js
@@ -0,0 +1,20 @@
/*
* Demo error messages and diff rendering with Mocha.
*/
"use strict";

var assert = require("..").assert;

describe("diff", function() {
it("multiline string", function() {
assert.equals("foo\nbar\ndoo\n", "bar\ndoo\nxyz\n");
});

it("objects", function() {
assert.equals({ foo: 42 }, { foo: 66 });
});

it("matchJson", function() {
assert.matchJson('{"foo":42,"bar":true}', { foo: 42, bar: false });
});
});
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -17,7 +17,8 @@
"precommit": "lint-staged",
"prepublishOnly": "npm run build && mkdocs gh-deploy -r upstream || mkdocs gh-deploy -r origin",
"test": "mocha 'lib/**/*.test.js'",
"test-coverage": "nyc --reporter text --reporter html --reporter lcovonly npm run test"
"test-coverage": "nyc --reporter text --reporter html --reporter lcovonly npm run test",
"demo": "mocha demo/*.test.js"
},
"lint-staged": {
"*.js": "eslint"
Expand Down

0 comments on commit ce794ee

Please sign in to comment.