Skip to content

Commit 234453e

Browse files
author
Jocelyn Badgley (Twipped)
committed
chore: fix tests
1 parent 5fad52b commit 234453e

23 files changed

+39
-28
lines changed

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
docs
2+
dist

.eslintrc.json

+10-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,16 @@
44
],
55
"rules": {
66
"jsdoc/require-jsdoc": "warn",
7-
"one-var": "off"
7+
"one-var": "off",
8+
"jsdoc/check-tag-names": [ "error", {
9+
"jsxTags": true,
10+
"definedTags": [
11+
"category",
12+
"component",
13+
"hidden",
14+
"internal"
15+
]
16+
} ]
817
},
918
"overrides": [
1019
{

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"scripts": {
2222
"test": "tap -R base --no-coverage tests",
2323
"cover": "tap -R terse --coverage tests",
24-
"lint": "eslint './{src,tests}/**/*.{js,jsx}'",
25-
"lint-fix": "eslint './{src,tests}/**/*.{js,jsx}' --fix",
24+
"lint": "eslint .",
25+
"lint-fix": "eslint . --fix",
2626
"docs": "rimraf docs && typedoc src/*.js --out docs --readme none --hideBreadcrumbs",
2727
"build": "rimraf dist && npm run build:cjs && npm run build:mjs && npm run build:types",
2828
"build:cjs": "babel src --out-dir dist --out-file-extension .cjs --ignore '**/__test__/*'",

src/suspend.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
import {isPromise} from './types.js';
1+
import { isPromise } from './types.js';
22

33
/**
44
* Basic little wrapper that ensures we always get a promise back.
55
*
6-
* @param fn
6+
* @param {Function} fn
77
* @param {...any} args
88
* @private
99
*/
10-
async function wrapPromise(fn, ...args) {
10+
async function wrapPromise (fn, ...args) {
1111
const res = await fn(...args);
1212
return res;
1313
}
1414
const suspensions = new Map();
1515

1616
class Failed {
17-
constructor(err) {
17+
constructor (err) {
1818
this.err = err;
1919
}
2020
}
@@ -44,7 +44,7 @@ class Failed {
4444
* @param {TaskCallback} fn The async task to perform.
4545
* @returns {any}
4646
*/
47-
export default function suspend(key, fn) {
47+
export default function suspend (key, fn) {
4848
if (typeof key !== 'string') throw new Error('suspend must receive a string key to test against.');
4949

5050
const cached = suspensions.get(key);
@@ -80,7 +80,7 @@ export default function suspend(key, fn) {
8080
*
8181
* @param {string} key The operation name to remove.
8282
*/
83-
export function resetSuspension(key) {
83+
export function resetSuspension (key) {
8484
suspensions.delete(key);
8585
}
8686

tests/convert.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import tap from 'tap';
3-
import { distance } from '../index.js';
3+
import { distance } from '../src/index.js';
44

55
tap.test('sf to m', async (t) => {
66

tests/difference.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import tap from 'tap';
3-
import { difference } from '../index.js';
3+
import { difference } from '../src/index.js';
44

55
tap.test('difference', async (t) => {
66

tests/empty.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import tap from 'tap';
3-
import { empty } from '../index.js';
3+
import { empty } from '../src/index.js';
44

55
tap.test('empty()', async (t) => {
66

tests/equal.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import tap from 'tap';
3-
import { equal } from '../index.js';
3+
import { equal } from '../src/index.js';
44

55
tap.test('object integers', async (t) => {
66

tests/first.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import tap from 'tap';
3-
import { first } from '../index.js';
3+
import { first } from '../src/index.js';
44

55

66
tap.test('first', async (t) => {

tests/get.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import tap from 'tap';
22
import { format as pretty } from 'pretty-format';
3-
import { get } from '../index.js';
3+
import { get } from '../src/index.js';
44

55
tap.test('get()', async (s) => {
66
s.test('should get string keyed property values', async (t) => {

tests/intersect.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import tap from 'tap';
3-
import { intersect } from '../index.js';
3+
import { intersect } from '../src/index.js';
44

55
tap.test('intersect', async (t) => {
66

tests/iterateObject.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import tap from 'tap';
3-
import { iterateObject } from '../index.js';
3+
import { iterateObject } from '../src/index.js';
44

55
tap.test('iterateObject', async (t) => {
66

tests/iterators.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import tap from 'tap';
3-
import { mapMode, isIterator, isIterable, isGenerator, ensureIterable, MAPMODE, map } from '../index.js';
3+
import { mapMode, isIterator, isIterable, isGenerator, ensureIterable, MAPMODE, map } from '../src/index.js';
44

55
const array = [ 1, 2, 3 ];
66
const object = { a: 1, b: 2, c: 3 };

tests/map.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import tap from 'tap';
3-
import { map } from '../index.js';
3+
import { map } from '../src/index.js';
44

55
tap.test('map object', async (t) => {
66
const targets = {

tests/memoize.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import tap from 'tap';
3-
import { memoize } from '../index.js';
3+
import { memoize } from '../src/index.js';
44

55
var value = 0;
66

tests/pdebounce.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import tap from 'tap';
3-
import pDebounce from '../src/pDebounce.js';
3+
import { pDebounce } from '../src/index.js';
44

55
function sleep (ms) {
66
return new Promise((resolve) => setTimeout(resolve, ms));

tests/pdefer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import tap from 'tap';
3-
import { pDefer } from '../index.js';
3+
import { pDefer } from '../src/index.js';
44

55
tap.test('pDefer()', async (s) => {
66
s.test('works', async (t) => {

tests/pdelay.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import tap from 'tap';
3-
import { pDelay } from '../index.js';
3+
import { pDelay } from '../src/index.js';
44

55
tap.test('pDelay()', async (s) => {
66
s.test('works', async (t) => {

tests/pmap.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import tap from 'tap';
3-
import { pMap, pDelay } from '../index.js';
3+
import { pMap, pDelay } from '../src/index.js';
44

55
const array = [ 100, 110, 70, 10, 11, 150, 220, 250 ];
66

tests/prace.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import tap from 'tap';
3-
import { pDelay, pRace } from '../index.js';
3+
import { pDelay, pRace } from '../src/index.js';
44

55
tap.test('promise race', async (t) => {
66

tests/preduce.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import tap from 'tap';
3-
import { pDelay, pReduce } from '../index.js';
3+
import { pDelay, pReduce } from '../src/index.js';
44

55
const array = [ 100, 110, 70, 10, 11, 150, 220, 250 ];
66

tests/reduce.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import tap from 'tap';
3-
import { reduce } from '../index.js';
3+
import { reduce } from '../src/index.js';
44

55
const array = [ 100, 110, 70, 10, 11, 150, 220, 250 ];
66

tests/uniq.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import tap from 'tap';
3-
import { uniq } from '../index.js';
3+
import { uniq } from '../src/index.js';
44

55
tap.test('uniq array', async (t) => {
66

0 commit comments

Comments
 (0)