Skip to content

Commit ce295a2

Browse files
authored
refactor: update ready message (#78)
* refactor: update ready message * chore: update message * chore: use another node arg --throw-deprecation will cause the test to fail since we are using ts-node, and ts-node use features that are deprecated with node 22
1 parent 8c08240 commit ce295a2

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/dev_server.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,9 @@ export class DevServer {
210210
.useColors(this.#colors)
211211
.useRenderer(this.#logger.getRenderer())
212212
.add(`Server address: ${this.#colors.cyan(`http://${host}:${message.port}`)}`)
213-
.add(
214-
`File system watcher: ${this.#colors.cyan(
215-
`${this.#isWatching ? 'enabled' : 'disabled'}`
216-
)}`
217-
)
213+
214+
const watchMode = this.#options.hmr ? 'HMR' : this.#isWatching ? 'Legacy' : 'None'
215+
displayMessage.add(`Watch Mode: ${this.#colors.cyan(watchMode)}`)
218216

219217
if (message.duration) {
220218
displayMessage.add(`Ready in: ${this.#colors.cyan(prettyHrtime(message.duration))}`)

tests/run.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ test.group('Child process', () => {
6060
const childProcess = runNode(fs.basePath, {
6161
script: 'foo.ts',
6262
scriptArgs: ['--watch', '--foo=bar'],
63-
nodeArgs: ['--throw-deprecation'],
63+
nodeArgs: ['--conditions=dev'],
6464
})
6565

6666
const payload = await pEvent(childProcess, 'message', { rejectionEvents: ['error'] })
@@ -74,7 +74,7 @@ test.group('Child process', () => {
7474
process.allowedNodeEnvironmentFlags.has('--disable-warning')
7575
? '--disable-warning=ExperimentalWarning'
7676
: '--no-warnings',
77-
'--throw-deprecation',
77+
'--conditions=dev',
7878
],
7979
})
8080
})

0 commit comments

Comments
 (0)