Skip to content

Commit a96bbad

Browse files
committed
Convert to chai since we don’t support IE8
1 parent b4c1a13 commit a96bbad

File tree

11 files changed

+19
-18
lines changed

11 files changed

+19
-18
lines changed

Gruntfile.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ module.exports = function(grunt) {
5353
mochaTest: {
5454
test: {
5555
options: {
56-
require: ['babel/register']
56+
require: ['babel/register'],
57+
reporter: 'dot'
5758
},
5859
src: ['test/**/*.js']
5960
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
"babel": "^5.8.20",
3232
"babel-core": "^5.8.20",
3333
"babel-loader": "^5.3.2",
34+
"chai": "^3.2.0",
3435
"colors": "^1.1.0",
3536
"eslint": "^1.0.0",
36-
"expect.js": "^0.3.1",
3737
"grunt": "^0.4.5",
3838
"grunt-babel": "^5.0.1",
3939
"grunt-clean": "^0.4.0",

test/convert/dmp.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {convertChangesToDMP} from '../../lib/convert/dmp';
22
import {diffWords} from '../../lib/diff/word';
33

4-
import expect from 'expect.js';
4+
import {expect} from 'chai';
55

66
describe('convertToDMP', function() {
77
it('should output diff-match-patch format', function() {

test/diff/character.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {diffChars} from '../../lib/diff/character';
22
import {convertChangesToXML} from '../../lib/convert/xml';
33

4-
import expect from 'expect.js';
4+
import {expect} from 'chai';
55

66
describe('diff/character', function() {
77
describe('#diffChars', function() {

test/diff/css.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {diffCss} from '../../lib/diff/css';
22
import {convertChangesToXML} from '../../lib/convert/xml';
33

4-
import expect from 'expect.js';
4+
import {expect} from 'chai';
55

66
describe('diff/css', function() {
77
describe('#diffCss', function() {

test/diff/json.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {diffJson, canonicalize} from '../../lib/diff/json';
22
import {convertChangesToXML} from '../../lib/convert/xml';
33

4-
import expect from 'expect.js';
4+
import {expect} from 'chai';
55

66
describe('diff/json', function() {
77
describe('#diffJson', function() {
@@ -70,7 +70,7 @@ describe('diff/json', function() {
7070
circular,
7171
{foo: 123, bar: {}}
7272
);
73-
}).to.throwError(/circular|cyclic/i);
73+
}).to['throw'](/circular|cyclic/i);
7474
});
7575
});
7676

test/diff/line.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {diffLines, diffTrimmedLines} from '../../lib/diff/line';
22
import {convertChangesToXML} from '../../lib/convert/xml';
33

4-
import expect from 'expect.js';
4+
import {expect} from 'chai';
55

66
describe('diff/line', function() {
77
// Line Diff

test/diff/sentence.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {diffSentences} from '../../lib/diff/sentence';
22
import {convertChangesToXML} from '../../lib/convert/xml';
33

4-
import expect from 'expect.js';
4+
import {expect} from 'chai';
55

66
describe('diff/sentence', function() {
77
describe('#diffSentences', function() {

test/diff/word.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {wordDiff, diffWords, diffWordsWithSpace} from '../../lib/diff/word';
22
import {convertChangesToXML} from '../../lib/convert/xml';
33

4-
import expect from 'expect.js';
4+
import {expect} from 'chai';
55

66
describe('WordDiff', function() {
77
describe('#diffWords', function() {
@@ -70,15 +70,15 @@ describe('WordDiff', function() {
7070
describe('#diffWords - async', function() {
7171
it('should diff whitespace', function(done) {
7272
diffWords('New Value', 'New ValueMoreData', function(err, diffResult) {
73-
expect(err).to.be(undefined);
73+
expect(err).to.be.undefined;
7474
expect(convertChangesToXML(diffResult)).to.equal('New <del>Value</del><ins>ValueMoreData</ins>');
7575
done();
7676
});
7777
});
7878

7979
it('should diff multiple whitespace values', function(done) {
8080
diffWords('New Value ', 'New ValueMoreData ', function(err, diffResult) {
81-
expect(err).to.be(undefined);
81+
expect(err).to.be.undefined;
8282
expect(convertChangesToXML(diffResult)).to.equal('New <del>Value</del><ins>ValueMoreData</ins> ');
8383
done();
8484
});
@@ -87,7 +87,7 @@ describe('WordDiff', function() {
8787
// Diff on word boundary
8888
it('should diff on word boundaries', function(done) {
8989
diffWords('New :Value:Test', 'New ValueMoreData ', function(err, diffResult) {
90-
expect(err).to.be(undefined);
90+
expect(err).to.be.undefined;
9191
expect(convertChangesToXML(diffResult)).to.equal('New <del>:Value:Test</del><ins>ValueMoreData </ins>');
9292
done();
9393
});
@@ -96,21 +96,21 @@ describe('WordDiff', function() {
9696
// Diff without changes
9797
it('should handle identity', function(done) {
9898
diffWords('New Value', 'New Value', function(err, diffResult) {
99-
expect(err).to.be(undefined);
99+
expect(err).to.be.undefined;
100100
expect(convertChangesToXML(diffResult)).to.equal('New Value');
101101
done();
102102
});
103103
});
104104
it('should handle empty', function(done) {
105105
diffWords('', '', function(err, diffResult) {
106-
expect(err).to.be(undefined);
106+
expect(err).to.be.undefined;
107107
expect(convertChangesToXML(diffResult)).to.equal('');
108108
done();
109109
});
110110
});
111111
it('should diff has identical content', function(done) {
112112
diffWords('New Value', 'New Value', function(err, diffResult) {
113-
expect(err).to.be(undefined);
113+
expect(err).to.be.undefined;
114114
expect(convertChangesToXML(diffResult)).to.equal('New Value');
115115
done();
116116
});

test/patch/apply.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {applyPatch} from '../../lib/patch/apply';
22
import {createPatch} from '../../lib/patch/create';
33

4-
import expect from 'expect.js';
4+
import {expect} from 'chai';
55

66
describe('patch/apply', function() {
77
describe('#applyPatch', function() {

test/patch/create.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {diffWords} from '../../lib';
22
import {createPatch, createTwoFilesPatch, structuredPatch} from '../../lib/patch/create';
33

4-
import expect from 'expect.js';
4+
import {expect} from 'chai';
55

66
const VERBOSE = false;
77
function log() {

0 commit comments

Comments
 (0)