Skip to content

Commit

Permalink
added tests for issue codemix#12
Browse files Browse the repository at this point in the history
  • Loading branch information
GerHobbelt committed Jul 5, 2020
1 parent 6489d4f commit fdca1c7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gerhobbelt/gitignore-parser",
"version": "0.0.3-1",
"version": "0.0.3-2",
"description": "A simple .gitignore parser.",
"keywords": [
"gitignore",
Expand All @@ -23,7 +23,7 @@
"build": "npm test",
"test": "mocha",
"watch": "mocha --watch",
"pub": "npm publish --public"
"pub": "npm publish --access public"
},
"author": {
"name": "Charles Pick",
Expand Down
22 changes: 22 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,26 @@ describe('gitignore parser', function() {
assert.strictEqual(gitignore.accepts('a/3/a'), false);
});
})

describe('issue #12', function () {
it('should not fail test A', function () {
var gitignore = parser.compile('/ajax/libs/bPopup/*b*');
assert.strictEqual(gitignore.accepts('/ajax/libs/bPopup/0.9.0'), true); //output false
});

it('should not fail test B', function () {
var gitignore = parser.compile('/ajax/libs/jquery-form-validator/2.2');
assert.strictEqual(gitignore.accepts('/ajax/libs/jquery-form-validator/2.2.43'), true); //output false
});

it('should not fail test C', function () {
var gitignore = parser.compile('/ajax/libs/punycode/2.0');
assert.strictEqual(gitignore.accepts('/ajax/libs/punycode/2.0.0'), true); //output false
});

it('should not fail test D', function () {
var gitignore = parser.compile('/ajax/libs/typescript/*dev*');
assert.strictEqual(gitignore.accepts('/ajax/libs/typescript/2.0.6-insiders.20161014'), true); //output false
});
});
});

0 comments on commit fdca1c7

Please sign in to comment.