Skip to content

Commit e605143

Browse files
committed
chore(deps): remove tmp
1 parent 26f9639 commit e605143

File tree

3 files changed

+13
-18
lines changed

3 files changed

+13
-18
lines changed

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
"@types/qunit": "2.9.1",
7777
"@types/resolve": "1.17.1",
7878
"@types/semver": "7.3.1",
79-
"@types/tmp": "0.2.0",
8079
"@typescript-eslint/eslint-plugin": "3.5.0",
8180
"@typescript-eslint/parser": "3.5.0",
8281
"broccoli-asset-rev": "3.0.0",
@@ -125,7 +124,6 @@
125124
"in-repo-a": "link:tests/dummy/lib/in-repo-a",
126125
"in-repo-b": "link:tests/dummy/lib/in-repo-b",
127126
"loader.js": "4.7.0",
128-
"tmp": "0.1.0",
129127
"mocha": "8.0.1",
130128
"prettier": "1.19.1",
131129
"prettier-eslint": "11.0.0",

ts/tests/helpers/skeleton-app.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import fs from 'fs-extra';
22
import path from 'path';
3-
import tmp from 'tmp';
43
import execa from 'execa';
54
import { EventEmitter } from 'events';
65
import got from 'got';
76
import debugLib from 'debug';
87

9-
tmp.setGracefulCleanup();
10-
118
const debug = debugLib('skeleton-app');
129

1310
const getEmberPort = (() => {
@@ -18,16 +15,18 @@ const getEmberPort = (() => {
1815
export default class SkeletonApp {
1916
port = getEmberPort();
2017
watched: WatchedBuild | null = null;
21-
tmpDir = tmp.dirSync({
22-
tries: 10,
23-
unsafeCleanup: true,
24-
dir: process.cwd(),
25-
template: 'test-skeleton-app-XXXXXX',
26-
});
27-
root = this.tmpDir.name;
18+
cleanupTempDir = () => fs.removeSync(this.root);
19+
root = path.join(
20+
process.cwd(),
21+
`test-skeleton-app-${Math.random()
22+
.toString(36)
23+
.slice(2)}`
24+
);
2825

2926
constructor() {
27+
fs.mkdirpSync(this.root);
3028
fs.copySync(`${__dirname}/../../../test-fixtures/skeleton-app`, this.root);
29+
process.on('beforeExit', this.cleanupTempDir);
3130
}
3231

3332
build() {
@@ -68,7 +67,9 @@ export default class SkeletonApp {
6867
if (this.watched) {
6968
this.watched.kill();
7069
}
71-
this.tmpDir.removeCallback();
70+
71+
this.cleanupTempDir();
72+
process.off('beforeExit', this.cleanupTempDir);
7273
}
7374

7475
_ember(args: string[]) {
@@ -95,6 +96,7 @@ class WatchedBuild extends EventEmitter {
9596

9697
this.ember.catch(error => {
9798
this.emit('did-error', error);
99+
console.error(error);
98100
});
99101
}
100102

yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1797,11 +1797,6 @@
17971797
dependencies:
17981798
"@types/node" "*"
17991799

1800-
"@types/tmp@0.2.0":
1801-
version "0.2.0"
1802-
resolved "https://registry.yarnpkg.com/@types/tmp/-/tmp-0.2.0.tgz#e3f52b4d7397eaa9193592ef3fdd44dc0af4298c"
1803-
integrity sha512-flgpHJjntpBAdJD43ShRosQvNC0ME97DCfGvZEDlAThQmnerRXrLbX6YgzRBQCZTthET9eAWFAMaYP0m0Y4HzQ==
1804-
18051800
"@types/tough-cookie@*":
18061801
version "4.0.0"
18071802
resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.0.tgz#fef1904e4668b6e5ecee60c52cc6a078ffa6697d"

0 commit comments

Comments
 (0)