Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: use common/tmpdir in watch-mode ipc test #45211

Merged
merged 1 commit into from Oct 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/fixtures/watch-mode/ipc.js
@@ -1,9 +1,9 @@
const path = require('node:path');
const url = require('node:url');
const os = require('node:os');
const fs = require('node:fs');
const tmpdir = require('../../common/tmpdir');
lpinca marked this conversation as resolved.
Show resolved Hide resolved

const tmpfile = path.join(os.tmpdir(), 'file');
const tmpfile = path.join(tmpdir.path, 'file');
fs.writeFileSync(tmpfile, '');

process.send({ 'watch:require': path.resolve(__filename) });
Expand Down
3 changes: 1 addition & 2 deletions test/parallel/test-watch-mode-files_watcher.mjs
Expand Up @@ -5,7 +5,6 @@ import tmpdir from '../common/tmpdir.js';
import path from 'node:path';
import assert from 'node:assert';
import process from 'node:process';
import os from 'node:os';
import { describe, it, beforeEach, afterEach } from 'node:test';
import { writeFileSync, mkdirSync } from 'node:fs';
import { setTimeout } from 'node:timers/promises';
Expand Down Expand Up @@ -153,7 +152,7 @@ describe('watch mode file watcher', () => {
const child = spawn(process.execPath, [file], { stdio: ['pipe', 'pipe', 'pipe', 'ipc'], encoding: 'utf8' });
watcher.watchChildProcessModules(child);
await once(child, 'exit');
let expected = [file, path.join(os.tmpdir(), 'file')];
let expected = [file, path.join(tmpdir.path, 'file')];
if (supportsRecursiveWatching) {
expected = expected.map((file) => path.dirname(file));
}
Expand Down