Skip to content

Commit

Permalink
Suppress console warns in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bigtimebuddy committed Feb 15, 2024
1 parent 28fcff0 commit 3a7d3fa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
15 changes: 2 additions & 13 deletions test/suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,19 +326,6 @@ function suite(useLegacy = false): void
}
});

if (!useLegacy)
{
describe(`filters.DistortionFilter${suffix}`, () =>
{
it('should create a DistortionFilter', () =>
{
const filter = new filters.DistortionFilter(0.5);

expect(filter.amount).toBe(0.5);
});
});
}

describe(`SoundInstance${suffix}`, () =>
{
afterEach(() =>
Expand Down Expand Up @@ -402,8 +389,10 @@ function suite(useLegacy = false): void

if (useLegacy)
{
const spy = jest.spyOn(console, 'warn').mockImplementation(() => { });

Check warning on line 392 in test/suite.ts

View workflow job for this annotation

GitHub Actions / build

Expected blank line after variable declarations

Check warning on line 392 in test/suite.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected empty arrow function

Check warning on line 392 in test/suite.ts

View workflow job for this annotation

GitHub Actions / build

Expected blank line after variable declarations

Check warning on line 392 in test/suite.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected empty arrow function
expect((instance as any).filters).toBe(null);
expect((instance2 as any).filters).toBe(null);
spy.mockRestore();
}
else
{
Expand Down
11 changes: 11 additions & 0 deletions test/webaudio.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
import { suite } from './suite';

Check warning on line 1 in test/webaudio.test.ts

View workflow job for this annotation

GitHub Actions / build

Run autofix to sort these imports!

Check warning on line 1 in test/webaudio.test.ts

View workflow job for this annotation

GitHub Actions / build

Run autofix to sort these imports!
import { filters } from '../src';

suite(false);

describe(`filters.DistortionFilter`, () =>
{
it('should create a DistortionFilter', () =>
{
const filter = new filters.DistortionFilter(0.5);

expect(filter.amount).toBe(0.5);
});
});

Check warning on line 14 in test/webaudio.test.ts

View workflow job for this annotation

GitHub Actions / build

Newline required at end of file but not found

Check warning on line 14 in test/webaudio.test.ts

View workflow job for this annotation

GitHub Actions / build

Newline required at end of file but not found

0 comments on commit 3a7d3fa

Please sign in to comment.