diff --git a/.npmignore b/.npmignore index ed937c41..fb99d385 100644 --- a/.npmignore +++ b/.npmignore @@ -6,6 +6,7 @@ test .eslintrc .gitignore .travis.yml +.npmignore Gruntfile.js index.html karma.conf.js diff --git a/Gruntfile.js b/Gruntfile.js index ee1f2af5..a438c833 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -53,7 +53,8 @@ module.exports = function(grunt) { mochaTest: { test: { options: { - require: ['babel/register'] + require: ['babel/register'], + reporter: 'dot' }, src: ['test/**/*.js'] } diff --git a/components/bower.json b/components/bower.json index 8437d13f..8da540ea 100644 --- a/components/bower.json +++ b/components/bower.json @@ -1,6 +1,6 @@ { "name": "jsdiff", - "version": "2.0.1", + "version": "2.0.2", "main": [ "diff.js" ], diff --git a/components/component.json b/components/component.json index 762b17fe..39378a91 100644 --- a/components/component.json +++ b/components/component.json @@ -6,7 +6,7 @@ "diff", "text" ], - "version": "2.0.1", + "version": "2.0.2", "scripts": [ "diff.js" ], "main": "diff.js", "license": "BSD" diff --git a/package.json b/package.json index b35a5b9f..5b0d3bf2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "diff", - "version": "2.0.1", + "version": "2.0.2", "description": "A javascript text diff implementation.", "keywords": [ "diff", @@ -31,9 +31,9 @@ "babel": "^5.8.20", "babel-core": "^5.8.20", "babel-loader": "^5.3.2", + "chai": "^3.2.0", "colors": "^1.1.0", "eslint": "^1.0.0", - "expect.js": "^0.3.1", "grunt": "^0.4.5", "grunt-babel": "^5.0.1", "grunt-clean": "^0.4.0", @@ -61,8 +61,5 @@ "webpack": "^1.10.5", "webpack-dev-server": "^1.10.1" }, - "optionalDependencies": {}, - "files": [ - "dist/diff.js" - ] + "optionalDependencies": {} } diff --git a/release-notes.md b/release-notes.md index 32b58c77..b93cf888 100644 --- a/release-notes.md +++ b/release-notes.md @@ -2,7 +2,13 @@ ## Development -[Commits](https://github.com/kpdecker/jsdiff/compare/v2.0.1...master) +[Commits](https://github.com/kpdecker/jsdiff/compare/v2.0.2...master) + +## v2.0.2 - August 8th, 2015 +- [#67](https://github.com/kpdecker/jsdiff/issues/67) - cannot require from npm module in node ([@commenthol](https://api.github.com/users/commenthol)) +- Convert to chai since we don’t support IE8 - a96bbad + +[Commits](https://github.com/kpdecker/jsdiff/compare/v2.0.1...v2.0.2) ## v2.0.1 - August 7th, 2015 - Add release build at proper step - 57542fd diff --git a/test/convert/dmp.js b/test/convert/dmp.js index 6812bcb1..f6ab6965 100644 --- a/test/convert/dmp.js +++ b/test/convert/dmp.js @@ -1,7 +1,7 @@ import {convertChangesToDMP} from '../../lib/convert/dmp'; import {diffWords} from '../../lib/diff/word'; -import expect from 'expect.js'; +import {expect} from 'chai'; describe('convertToDMP', function() { it('should output diff-match-patch format', function() { diff --git a/test/diff/character.js b/test/diff/character.js index be90e36e..e0fb8be5 100644 --- a/test/diff/character.js +++ b/test/diff/character.js @@ -1,7 +1,7 @@ import {diffChars} from '../../lib/diff/character'; import {convertChangesToXML} from '../../lib/convert/xml'; -import expect from 'expect.js'; +import {expect} from 'chai'; describe('diff/character', function() { describe('#diffChars', function() { diff --git a/test/diff/css.js b/test/diff/css.js index 42568e7f..2b7277a2 100644 --- a/test/diff/css.js +++ b/test/diff/css.js @@ -1,7 +1,7 @@ import {diffCss} from '../../lib/diff/css'; import {convertChangesToXML} from '../../lib/convert/xml'; -import expect from 'expect.js'; +import {expect} from 'chai'; describe('diff/css', function() { describe('#diffCss', function() { diff --git a/test/diff/json.js b/test/diff/json.js index 9390313d..433d78d4 100644 --- a/test/diff/json.js +++ b/test/diff/json.js @@ -1,7 +1,7 @@ import {diffJson, canonicalize} from '../../lib/diff/json'; import {convertChangesToXML} from '../../lib/convert/xml'; -import expect from 'expect.js'; +import {expect} from 'chai'; describe('diff/json', function() { describe('#diffJson', function() { @@ -70,7 +70,7 @@ describe('diff/json', function() { circular, {foo: 123, bar: {}} ); - }).to.throwError(/circular|cyclic/i); + }).to['throw'](/circular|cyclic/i); }); }); diff --git a/test/diff/line.js b/test/diff/line.js index 92fa9760..00e5a8a9 100644 --- a/test/diff/line.js +++ b/test/diff/line.js @@ -1,7 +1,7 @@ import {diffLines, diffTrimmedLines} from '../../lib/diff/line'; import {convertChangesToXML} from '../../lib/convert/xml'; -import expect from 'expect.js'; +import {expect} from 'chai'; describe('diff/line', function() { // Line Diff diff --git a/test/diff/sentence.js b/test/diff/sentence.js index 577070c4..81c5edc3 100644 --- a/test/diff/sentence.js +++ b/test/diff/sentence.js @@ -1,7 +1,7 @@ import {diffSentences} from '../../lib/diff/sentence'; import {convertChangesToXML} from '../../lib/convert/xml'; -import expect from 'expect.js'; +import {expect} from 'chai'; describe('diff/sentence', function() { describe('#diffSentences', function() { diff --git a/test/diff/word.js b/test/diff/word.js index 61a8adb8..be5f0539 100644 --- a/test/diff/word.js +++ b/test/diff/word.js @@ -1,7 +1,7 @@ import {wordDiff, diffWords, diffWordsWithSpace} from '../../lib/diff/word'; import {convertChangesToXML} from '../../lib/convert/xml'; -import expect from 'expect.js'; +import {expect} from 'chai'; describe('WordDiff', function() { describe('#diffWords', function() { @@ -70,7 +70,7 @@ describe('WordDiff', function() { describe('#diffWords - async', function() { it('should diff whitespace', function(done) { diffWords('New Value', 'New ValueMoreData', function(err, diffResult) { - expect(err).to.be(undefined); + expect(err).to.be.undefined; expect(convertChangesToXML(diffResult)).to.equal('New ValueValueMoreData'); done(); }); @@ -78,7 +78,7 @@ describe('WordDiff', function() { it('should diff multiple whitespace values', function(done) { diffWords('New Value ', 'New ValueMoreData ', function(err, diffResult) { - expect(err).to.be(undefined); + expect(err).to.be.undefined; expect(convertChangesToXML(diffResult)).to.equal('New ValueValueMoreData '); done(); }); @@ -87,7 +87,7 @@ describe('WordDiff', function() { // Diff on word boundary it('should diff on word boundaries', function(done) { diffWords('New :Value:Test', 'New ValueMoreData ', function(err, diffResult) { - expect(err).to.be(undefined); + expect(err).to.be.undefined; expect(convertChangesToXML(diffResult)).to.equal('New :Value:TestValueMoreData '); done(); }); @@ -96,21 +96,21 @@ describe('WordDiff', function() { // Diff without changes it('should handle identity', function(done) { diffWords('New Value', 'New Value', function(err, diffResult) { - expect(err).to.be(undefined); + expect(err).to.be.undefined; expect(convertChangesToXML(diffResult)).to.equal('New Value'); done(); }); }); it('should handle empty', function(done) { diffWords('', '', function(err, diffResult) { - expect(err).to.be(undefined); + expect(err).to.be.undefined; expect(convertChangesToXML(diffResult)).to.equal(''); done(); }); }); it('should diff has identical content', function(done) { diffWords('New Value', 'New Value', function(err, diffResult) { - expect(err).to.be(undefined); + expect(err).to.be.undefined; expect(convertChangesToXML(diffResult)).to.equal('New Value'); done(); }); diff --git a/test/patch/apply.js b/test/patch/apply.js index 41ce049f..47327f6d 100644 --- a/test/patch/apply.js +++ b/test/patch/apply.js @@ -1,7 +1,7 @@ import {applyPatch} from '../../lib/patch/apply'; import {createPatch} from '../../lib/patch/create'; -import expect from 'expect.js'; +import {expect} from 'chai'; describe('patch/apply', function() { describe('#applyPatch', function() { diff --git a/test/patch/create.js b/test/patch/create.js index e43731f6..d1ae33a4 100644 --- a/test/patch/create.js +++ b/test/patch/create.js @@ -1,7 +1,7 @@ import {diffWords} from '../../lib'; import {createPatch, createTwoFilesPatch, structuredPatch} from '../../lib/patch/create'; -import expect from 'expect.js'; +import {expect} from 'chai'; const VERBOSE = false; function log() {