Skip to content

Commit

Permalink
Add index.js which give access to all features of library
Browse files Browse the repository at this point in the history
  • Loading branch information
Mingun committed Apr 8, 2018
1 parent 33c6c65 commit 0edb212
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
File renamed without changes.
6 changes: 6 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use strict';

module.exports = {
Diff: require('./diff'),
generateDiff: require('./generate'),
};
9 changes: 8 additions & 1 deletion test/diff.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

let Diff = require('../lib/diff');
let generate = require('../lib/object');
let generate = require('../lib/generate');
let schema = require('../diff.schema.json');

let chai = require('chai');
Expand Down Expand Up @@ -247,6 +247,13 @@ describe('structured-diff', function() {
});
}

it('API works', function() {
expect(require('../lib')).to.deep.equals({
Diff: Diff,
generateDiff: generate
});
});

it('generate unified differencies', function() {
expect(new Diff(
'{\nstring\n}',
Expand Down
2 changes: 1 addition & 1 deletion test/hunk.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

let diff = require('../lib/object');
let diff = require('../lib/generate');
let toHunks = require('../lib/hunk');

let chai = require('chai');
Expand Down

0 comments on commit 0edb212

Please sign in to comment.