Skip to content

Commit

Permalink
Check stderr, not logger
Browse files Browse the repository at this point in the history
  • Loading branch information
jathak committed Sep 16, 2024
1 parent bf3030a commit 2e95b1d
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions js-api-spec/deprecations.node.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit 2e95b1d

Please sign in to comment.