diff --git a/tests/e2e/sandbox/sandbox.ts b/tests/.config/sandbox.ts similarity index 93% rename from tests/e2e/sandbox/sandbox.ts rename to tests/.config/sandbox.ts index ad08150..f0349a8 100644 --- a/tests/e2e/sandbox/sandbox.ts +++ b/tests/.config/sandbox.ts @@ -1,8 +1,9 @@ import { execSync } from 'child_process'; -import { mkdirSync, rmSync, writeFileSync } from 'fs'; +import { mkdirSync, rmSync, writeFileSync, mkdtempSync } from 'fs'; import { rimrafSync } from 'rimraf'; import isCi from 'is-ci'; import * as path from 'path'; +import { tmpdir } from 'os'; export interface SandboxOptions { esm?: boolean; @@ -18,7 +19,7 @@ export class Sandbox { private readonly esm: boolean; public constructor(options?: SandboxOptions) { - this.projectPath = path.resolve(__dirname, 'app'); + this.projectPath = mkdtempSync(tmpdir()); this.esm = options?.esm ?? false; } diff --git a/tests/e2e/commonjs.spec.ts b/tests/e2e/commonjs.spec.ts index 939cad3..d9c9ed2 100644 --- a/tests/e2e/commonjs.spec.ts +++ b/tests/e2e/commonjs.spec.ts @@ -6,7 +6,7 @@ import { RRule, RRuleSet, } from '../../src'; -import { Sandbox } from './sandbox/sandbox'; +import { Sandbox } from './../.config/sandbox'; import { beforeAll, afterAll, describe, it, expect } from 'vitest'; describe('Commonjs', () => { diff --git a/tests/e2e/esm.spec.ts b/tests/e2e/esm.spec.ts index 487c229..03449a4 100644 --- a/tests/e2e/esm.spec.ts +++ b/tests/e2e/esm.spec.ts @@ -6,7 +6,7 @@ import { RRuleSet, DtStart, } from '../../src'; -import { Sandbox } from './sandbox/sandbox'; +import { Sandbox } from './../.config/sandbox'; import { beforeAll, afterAll, describe, it, expect } from 'vitest'; describe('ESM', () => { diff --git a/tests/e2e/sandbox/.gitignore b/tests/e2e/sandbox/.gitignore deleted file mode 100644 index 7a0b7f0..0000000 --- a/tests/e2e/sandbox/.gitignore +++ /dev/null @@ -1 +0,0 @@ -app \ No newline at end of file