Skip to content

Commit 6f63744

Browse files
Fix the tmp FS tests.
1 parent 0fce85b commit 6f63744

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/test/common/platform/filesystem.functional.test.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,23 +94,20 @@ class FSFixture {
9494
}
9595
}
9696

97-
suite('Temporary files', () => {
97+
suite('FileSystem - Temporary files', () => {
9898
let tmp: ITempFileSystem;
9999
setup(() => {
100100
tmp = new TempFileSystem();
101101
});
102102

103103
suite('createFile', () => {
104104
test('TemporaryFile is populated properly', async () => {
105-
const expected: TemporaryFile = {
106-
filePath: '/tmp/xyz.tmp',
107-
dispose: (() => undefined)
108-
};
109-
110105
const tempfile = await tmp.createFile('.tmp');
106+
await fsextra.stat(tempfile.filePath); // This should not fail.
111107
tempfile.dispose();
112108

113-
expect(tempfile.filePath).to.deep.equal(expected);
109+
await ensureDoesNotExist(tempfile.filePath);
110+
expect(tempfile.filePath.endsWith('.tmp')).to.equal(true, `bad suffix on ${tempfile.filePath}`);
114111
});
115112

116113
test('fails if the target temp directory does not exist', async () => {

src/test/common/platform/filesystem.unit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ interface IRawFS {
4545
file(options: { }, cb: TempCallback): void;
4646
}
4747

48-
suite('Temporary files', () => {
48+
suite('FileSystem - Temporary files', () => {
4949
let raw: TypeMoq.IMock<IRawFS>;
5050
let tmp: ITempFileSystem;
5151
setup(() => {

0 commit comments

Comments
 (0)