0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-02-03 23:09:17 -05:00
verdaccio/test/e2e-cli/setup/test_environment.ts
Juan Picado 69d7df20d8
build: enable pnp yarn2 (#2253)
* chore: enable pnp yarn

* chore: ignore pnp

* fix type issues on run eslint

* add missing dependency and fix some errors

* fix most of the errors

some were just disabled, already fixed in master

* add missing jest-config

* update jest@26 align with other deps

* add missing @babel/register

* clean up

* use yarn node

* use yarn node on release

* chore: add husky 6

* chore: add husky 6

* chore: lint-stage

* chore: test

* chore: add hook git

* chore: test

* chore: test

* update deps

* chore: fix commit lint

* fix docker run

* update git ignore
2021-05-13 23:13:57 +02:00

30 lines
768 B
TypeScript

import os from 'os';
import path from 'path';
import NodeEnvironment from 'jest-environment-node';
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;