From 2e95b1d69b5fc0b4c64881311213832e0934b1d6 Mon Sep 17 00:00:00 2001 From: Jennifer Thakar Date: Mon, 16 Sep 2024 15:32:31 -0700 Subject: [PATCH] Check stderr, not logger --- js-api-spec/deprecations.node.test.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/js-api-spec/deprecations.node.test.ts b/js-api-spec/deprecations.node.test.ts index 069b581ef..a1df09e33 100644 --- a/js-api-spec/deprecations.node.test.ts +++ b/js-api-spec/deprecations.node.test.ts @@ -8,16 +8,13 @@ import {deprecations, renderSync, Deprecation, Version} from 'sass'; import {captureStdio} from './utils'; describe('a warning from the JS API', () => { - it('is emitted with no flags', done => { - renderSync({ - data: 'a { b: c; }', - logger: { - warn(message: string) { - expect(message).toContain('legacy JS API is deprecated'); - done(); - }, - }, + it('is emitted with no flags', () => { + const stdio = captureStdio(() => { + renderSync({ + data: 'a { b: c; }', + }); }); + expect(stdio.err).toContain('legacy-js-api'); }); it('is not emitted when deprecation silenced', () => {