1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-13 03:35:52 +01:00
verdaccio/test/e2e-cli/setup/test_environment.ts
Juan Picado 93468211d6
chore: update eslint dependencies (#2126)
* chore: update eslint

* chore: update rules and style

* chore: aling formatting

* chore: update ci rules

* chore: aling formatting

* chore: aling formatting
2021-03-14 08:42:46 +01:00

30 lines
725 B
TypeScript

const fs = require('fs');
import os from 'os';
import path from 'path';
import NodeEnvironment from 'jest-environment-node';
const __global = require('../utils/global');
// import { npm } from '../utils/process';
class E2ECliTestEnvironment extends NodeEnvironment {
constructor(config) {
super(config);
}
async setup() {
const tempRoot = fs.mkdtempSync(
path.join(fs.realpathSync(os.tmpdir()), 'verdaccio-suite-test-')
);
__global.addItem('dir-root', tempRoot);
this.global.__namespace = __global;
console.log(`current directory: ${process.cwd()}`);
}
async teardown() {}
runScript(script): any {
return super.runScript(script);
}
}
export default E2ECliTestEnvironment;