Skip to content

Commit

Permalink
chore: supertape: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Mar 5, 2023
1 parent 083b3e9 commit 83dabc7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
6 changes: 4 additions & 2 deletions packages/operator-stub/lib/stub.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import {

import * as operator from './stub.js';

const noop = () => {};

const test = extend(operator);

test('supertape: operator: stub: not called', (t) => {
Expand Down Expand Up @@ -188,12 +190,12 @@ test('supertape: operator: stub: calledWith: deep equals', (t) => {

const obj = {
hello: 'world',
f: () => {},
f: noop,
};

fn(obj);

t.calledWith(fn, [{hello: 'world', f: () => {}}]);
t.calledWith(fn, [{hello: 'world', f: noop}]);
t.end();
});

Expand Down
10 changes: 8 additions & 2 deletions packages/supertape/lib/cli.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ const {reRequire, stopAll} = mockRequire;
const {assign} = Object;

test('supertape: cli: -r', async (t) => {
const argv = ['-r', 'hello'];
const argv = [
'-r',
'hello',
];
const write = stub();
const stderr = {
write,
Expand Down Expand Up @@ -79,7 +82,10 @@ test('supertape: bin: cli: glob', async (t) => {
});

test('supertape: bin: cli: glob: a couple', async (t) => {
const argv = ['hello', 'world'];
const argv = [
'hello',
'world',
];
const sync = stub().returns([]);

mockRequire('glob', {
Expand Down
6 changes: 4 additions & 2 deletions packages/supertape/lib/diff.spec.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import test from './supertape.js';
import diff from './diff.mjs';

const noop = () => {};

test('supertape: diff', (t) => {
const diffed = diff(undefined, 'hello');
const {length} = diffed.split('\n');
Expand All @@ -12,11 +14,11 @@ test('supertape: diff', (t) => {

test('supertape: diff: no diff', (t) => {
const a = {
fn: () => {},
fn: noop,
};

const b = {
fn: () => {},
fn: noop,
};

const diffed = diff(a, b);
Expand Down
6 changes: 4 additions & 2 deletions packages/supertape/lib/operators.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import {
operators,
} from './operators.mjs';

const noop = () => {};

const {stringify} = JSON;

test('supertape: operators: extendOperators', async (t) => {
Expand Down Expand Up @@ -104,11 +106,11 @@ test('supertape: operators: deepEqual: no visual differences', async (t) => {
const {deepEqual} = initOperators(getStubs({formatter}));

const a = {
fn: () => {},
fn: noop,
};

const b = {
fn: () => {},
fn: noop,
};
const [[result]] = await Promise.all([
once(formatter, 'test:success'),
Expand Down

0 comments on commit 83dabc7

Please sign in to comment.