Skip to content

Commit

Permalink
Update to latest version of most dependencies; closes byteclubfr#6
Browse files Browse the repository at this point in the history
  • Loading branch information
evanp committed Mar 21, 2018
1 parent 871fb38 commit a4c68f5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
"author": "Nicolas Chambrier <[email protected]>",
"license": "ISC",
"dependencies": {
"lodash": "^3.5.0"
"lodash": "^4.17.5"
},
"devDependencies": {
"eslint": "^0.17.1",
"expect": "^1.6.0",
"mocha": "^2.2.1"
"eslint": "^0.24.1",
"expect": "^22.4.3",
"mocha": "^5.0.4"
},
"directories": {
"test": "test"
Expand Down
18 changes: 10 additions & 8 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ describe("TodoTxt", function () {

it("should parse line", function () {
var items = todotxt.parse("Some text");
expect(items).toBeAn(Array);
expect(Array.isArray(items)).toBe(true);
expect(items.length).toEqual(1);
var item = items[0];
expect(item).toBeAn(Object);
expect(typeof item).toBe("object");
expect(item.text).toEqual("Some text");
});

Expand All @@ -39,19 +39,21 @@ describe("TodoTxt", function () {
it("should expose methods to handle projects & contexts", function () {
var item = todotxt.parse("Some text")[0];
// Default values
expect(item.addProject).toBeA(Function);
expect(item.removeProject).toBeA(Function);
expect(item.addContext).toBeA(Function);
expect(item.removeContext).toBeA(Function);
expect(typeof item.addProject).toBe("function");
expect(typeof item.removeProject).toBe("function");
expect(typeof item.addContext).toBe("function");
expect(typeof item.removeContext).toBe("function");
});

it("should parse completed task", function () {
var item = todotxt.parse("x 2015-03-20 2015-03-21 Some text")[0];
expect(item.text).toEqual("Some text");
expect(item.date).toBeA(Date);
expect(typeof item.date).toBe("object");
expect(item.date instanceof Date).toEqual(true);
expect(item.date.getDate()).toEqual(21);
expect(item.complete).toEqual(true);
expect(item.completeDate).toBeA(Date);
expect(typeof item.date).toBe("object");
expect(item.date instanceof Date).toEqual(true);
expect(item.completeDate.getDate()).toEqual(20);
});

Expand Down

0 comments on commit a4c68f5

Please sign in to comment.