-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
check-dependencies.spec.ts
43 lines (39 loc) · 1.04 KB
/
check-dependencies.spec.ts
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
42
43
import { calculateProjectDependencies } from '@nrwl/workspace/src/utilities/buildable-libs-utils';
import { checkDependencies } from './check-dependencies';
jest.mock('@nrwl/workspace/src/utilities/buildable-libs-utils');
describe('checkDependencies', () => {
test('collects shallow dependencies', () => {
const mockedCalculateProjectDependencies = jest.mocked(
calculateProjectDependencies
);
mockedCalculateProjectDependencies.mockReturnValueOnce({
target: {
name: 'example',
type: 'lib',
data: {},
},
dependencies: [],
nonBuildableDependencies: [],
topLevelDependencies: [],
});
checkDependencies(
{
root: 'root',
projectName: 'example',
targetName: 'build',
cwd: '?',
workspace: null,
isVerbose: false,
},
'pathToTsConfig.json'
);
expect(calculateProjectDependencies).toBeCalledWith(
expect.anything(),
'root',
'example',
'build',
undefined,
true
);
});
});