[kbn-build/linkExectuables] add test with dev dependencies (#16621) (#16650)

* [kbn-build/linkExectuables] add test with dev dependencies

* [kbn-build/linkProjectExecutables] update test snapshots
This commit is contained in:
Spencer 2018-02-09 15:35:46 -07:00 committed by GitHub
parent 9e885e88be
commit 247e43dab4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 4 deletions

View file

@ -9,6 +9,9 @@ Object {
Array [
"<repoRoot>/packages/kbn-build/src/utils/bar/bin/bar.js",
],
Array [
"<repoRoot>/packages/kbn-build/src/utils/bar/bin/bar.js",
],
],
"mkdirp": Array [],
}
@ -21,6 +24,10 @@ Object {
"<repoRoot>/packages/kbn-build/src/utils/foo/node_modules/.bin/bar",
"755",
],
Array [
"<repoRoot>/packages/kbn-build/src/utils/baz/node_modules/.bin/bar",
"755",
],
],
"createSymlink": Array [
Array [
@ -28,17 +35,28 @@ Object {
"<repoRoot>/packages/kbn-build/src/utils/foo/node_modules/.bin/bar",
"exec",
],
Array [
"<repoRoot>/packages/kbn-build/src/utils/bar/bin/bar.js",
"<repoRoot>/packages/kbn-build/src/utils/baz/node_modules/.bin/bar",
"exec",
],
],
"isDirectory": Array [],
"isFile": Array [
Array [
"<repoRoot>/packages/kbn-build/src/utils/bar/bin/bar.js",
],
Array [
"<repoRoot>/packages/kbn-build/src/utils/bar/bin/bar.js",
],
],
"mkdirp": Array [
Array [
"<repoRoot>/packages/kbn-build/src/utils/foo/node_modules/.bin",
],
Array [
"<repoRoot>/packages/kbn-build/src/utils/baz/node_modules/.bin",
],
],
}
`;
@ -48,5 +66,8 @@ Array [
Array [
"[foo] bar -> ../bar/bin/bar.js",
],
Array [
"[baz] bar -> ../bar/bin/bar.js",
],
]
`;

View file

@ -6,6 +6,7 @@ import {
} from '../test_helpers';
import { linkProjectExecutables } from './link_project_executables';
import { Project } from './project';
import { buildProjectGraph } from './projects';
const projectsByName = new Map([
[
@ -30,12 +31,21 @@ const projectsByName = new Map([
resolve(__dirname, 'bar')
),
],
[
'baz',
new Project(
{
name: 'baz',
devDependencies: {
bar: 'link:../bar',
},
},
resolve(__dirname, 'baz')
),
],
]);
const projectGraph = new Map([
['foo', [projectsByName.get('bar')]],
['bar', []],
]);
const projectGraph = buildProjectGraph(projectsByName);
function getFsMockCalls() {
const fs = require('./fs');