0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-20 22:52:46 -05:00
verdaccio/test/e2e-cli/setup/test_environment.ts
Juan Picado 558fcafc71
build: format code prettier, enable ci (#2886)
* fix: format code prettier, enable ci

* chore: add trivago import prettier pluggin
2022-01-09 20:51:50 +01:00

29 lines
757 B
TypeScript

import NodeEnvironment from 'jest-environment-node';
import os from 'os';
import path from 'path';
const fs = require('fs');
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;
// eslint-disable-next-line no-console
console.log(`current directory: ${process.cwd()}`);
}
async teardown() {}
runScript(script): any {
return super.runScript(script);
}
}
export default E2ECliTestEnvironment;