Skip to content

Commit

Permalink
test: type ava context
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Sep 14, 2021
1 parent 69e0560 commit 9047bec
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
17 changes: 12 additions & 5 deletions test/roarr/integrations/log.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
/* eslint-disable node/no-process-env */
/* eslint-disable ava/use-test */

import test, {
afterEach,
beforeEach,
import type {
TestInterface,
} from 'ava';
import anyTest from 'ava';
import * as sinon from 'sinon';

beforeEach(async (t) => {
process.env.ROARR_LOG = 1;
const test = anyTest as TestInterface<{
ROARR: any,
Roarr: any,
write: sinon.SinonStubbedMember<(message: string) => void>,
}>;

test.beforeEach(async (t) => {
process.env.ROARR_LOG = '1';

const {
Roarr,
Expand Down
17 changes: 12 additions & 5 deletions test/roarr/integrations/noLog.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
/* eslint-disable node/no-process-env */
/* eslint-disable ava/use-test */

import test, {
afterEach,
beforeEach,
import type {
TestInterface,
} from 'ava';
import anyTest from 'ava';
import * as sinon from 'sinon';

beforeEach(async (t) => {
process.env.ROARR_LOG = 0;
const test = anyTest as TestInterface<{
ROARR: any,
Roarr: any,
write: sinon.SinonStubbedMember<(message: string) => void>,
}>;

test.beforeEach(async (t) => {
process.env.ROARR_LOG = '0';

const {
Roarr,
Expand Down

0 comments on commit 9047bec

Please sign in to comment.