forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresolve_spec.ts
More file actions
26 lines (20 loc) · 751 Bytes
/
Copy pathresolve_spec.ts
File metadata and controls
26 lines (20 loc) · 751 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
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// tslint:disable:no-any
// tslint:disable-next-line:no-implicit-dependencies
import { resolve } from '@angular-devkit/core/node';
import * as path from 'path';
const devKitRoot = (global as any)._DevKitRoot;
describe('resolve', () => {
it('works', () => {
expect(resolve('tslint', { basedir: __dirname }))
.toBe(path.join(devKitRoot, 'node_modules/tslint/lib/index.js'));
expect(() => resolve('npm', { basedir: '/' })).toThrow();
expect(() => resolve('npm', { basedir: '/', checkGlobal: true })).not.toThrow();
});
});