-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.js
41 lines (37 loc) · 840 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*!
* is-dotfile <https://github.com/regexps/is-dotfile>
*
* Copyright (c) 2015 Jon Schlinkert.
* Licensed under the MIT License
*/
'use strict';
require('mocha');
var assert = require('assert');
var isDotfile = require('./');
describe('is-dotfile', function() {
var truthy = [
'a/b/c/d/e.js',
'a/b.js',
'a/.git/c/a.js',
'.github/contributor.md',
'.git/foo',
].forEach(function(filepath) {
it('should be false: ' + filepath, function() {
assert(!isDotfile(filepath));
});
});
var falsey = [
'.git',
'.travis.yml',
'.editorconfig',
'/.git',
'a/b.c.d/e.js/.git',
'a/.b/c/.gitignore',
'a/.gitignore',
'a/b/c/d/.gitignore',
].forEach(function(filepath) {
it('should be true: ' + filepath, function() {
assert(isDotfile(filepath));
});
});
});