-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.js
More file actions
34 lines (28 loc) · 889 Bytes
/
test.js
File metadata and controls
34 lines (28 loc) · 889 Bytes
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
'use strict';
const hasLockfile = require('.');
test('no lockfiles', () => {
expect(hasLockfile()).toBe(false);
expect(hasLockfile.lockfiles()).toEqual([]);
});
test('package-lock.json', () => {
expect(hasLockfile('fixtures/bar')).toBe(true);
expect(hasLockfile.lockfiles('fixtures/bar')).toEqual(['package-lock.json']);
});
test('yarn.lock', () => {
expect(hasLockfile('fixtures/baz')).toBe(true);
expect(hasLockfile.lockfiles('fixtures/baz')).toEqual(['yarn.lock']);
});
test('npm-shrinkwrap.json', () => {
expect(hasLockfile('fixtures/foo')).toBe(true);
expect(hasLockfile.lockfiles('fixtures/foo')).toEqual([
'npm-shrinkwrap.json',
]);
});
test('all lockfiles', () => {
expect(hasLockfile('fixtures/qux')).toBe(true);
expect(hasLockfile.lockfiles('fixtures/qux')).toEqual([
'package-lock.json',
'yarn.lock',
'npm-shrinkwrap.json',
]);
});