File size: 683 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import * as path from 'path';
import * as shell from 'shelljs';

export const rootDir = process.cwd();

shell.config.silent = true;

export function setupStageWithFixture(
  testDir: string,
  stageName: string,
  fixtureName: string
): void {
  const stagePath = path.join(rootDir, stageName);
  shell.mkdir(stagePath);
  shell.exec(
    `cp -a ${rootDir}/test/${testDir}/fixtures/${fixtureName}/. ${stagePath}/`
  );
  shell.ln(
    '-s',
    path.join(rootDir, 'node_modules'),
    path.join(stagePath, 'node_modules')
  );
  shell.cd(stagePath);
}

export function teardownStage(stageName: string): void {
  shell.cd(rootDir);
  shell.rm('-rf', path.join(rootDir, stageName));
}