Skip to content

Commit

Permalink
Get "deprecated installed package test" work
Browse files Browse the repository at this point in the history
  • Loading branch information
KristjanESPERANTO committed Nov 18, 2024
1 parent 9ee6adc commit 79a7fe7
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ import { test } from 'node:test'
console.log('Running tests...')

test('current tests', async (t) => {
await t.todo('check if deprecation warning is shown', (_t, done) => {
exec('npm i request && npm run dev current', { timeout: 60000 }, (_error, _stdout, stderr) => {
assert.ok(/has been deprecated/.test(stderr), 'Expected "has been deprecated" to be mentioned in deprecation warning.')
await t.test('check if no deprecation warning is shown', (_t, done) => {
exec('npm run dev current', (_error, _stdout, stderr) => {
assert.ok(!/has been deprecated/.test(stderr), 'Not expected "has been deprecated" to be mentioned in deprecation warning.')
done()
})
})

await t.test('check if no deprecation warning is shown', (_t, done) => {
exec('npm run dev current', (_error, _stdout, stderr) => {
assert.ok(!/has been deprecated/.test(stderr), 'Not expected "has been deprecated" to be mentioned in deprecation warning.')
await t.test('check if deprecation warning is shown if deprecated package is installed', (_t, done) => {
exec('pnpm i request && npm run dev current', { timeout: 160000 }, (_error, _stdout, stderr) => {
assert.ok(/request has been deprecated/.test(stderr), 'Expected "has been deprecated" to be mentioned in deprecation warning.')
// Cleanup: Undo the installation
exec('pnpm remove request')
done()
})
})
Expand Down

0 comments on commit 79a7fe7

Please sign in to comment.