Skip to content

Commit 4e4623b

Browse files
authored
test(e2e): run sandbox in system OS dir (#642)
1 parent f76af01 commit 4e4623b

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { execSync } from 'child_process';
2-
import { mkdirSync, rmSync, writeFileSync } from 'fs';
2+
import { mkdirSync, rmSync, writeFileSync, mkdtempSync } from 'fs';
33
import { rimrafSync } from 'rimraf';
44
import isCi from 'is-ci';
55
import * as path from 'path';
6+
import { tmpdir } from 'os';
67

78
export interface SandboxOptions {
89
esm?: boolean;
@@ -18,7 +19,7 @@ export class Sandbox {
1819
private readonly esm: boolean;
1920

2021
public constructor(options?: SandboxOptions) {
21-
this.projectPath = path.resolve(__dirname, 'app');
22+
this.projectPath = mkdtempSync(tmpdir());
2223
this.esm = options?.esm ?? false;
2324
}
2425

tests/e2e/commonjs.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
RRule,
77
RRuleSet,
88
} from '../../src';
9-
import { Sandbox } from './sandbox/sandbox';
9+
import { Sandbox } from './../.config/sandbox';
1010
import { beforeAll, afterAll, describe, it, expect } from 'vitest';
1111

1212
describe('Commonjs', () => {

tests/e2e/esm.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
RRuleSet,
77
DtStart,
88
} from '../../src';
9-
import { Sandbox } from './sandbox/sandbox';
9+
import { Sandbox } from './../.config/sandbox';
1010
import { beforeAll, afterAll, describe, it, expect } from 'vitest';
1111

1212
describe('ESM', () => {

tests/e2e/sandbox/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)