1
0

run npm install to generate a package lock

This commit is contained in:
sashinexists
2024-12-07 13:18:31 +11:00
parent e7d08a91b5
commit 23437d228e
2501 changed files with 290663 additions and 0 deletions

109
node_modules/promise-make-naked/test/index.js generated vendored Normal file
View File

@@ -0,0 +1,109 @@
/* IMPORT */
import {describe} from 'fava';
import makeNakedPromise from '../dist/index.js';
/* MAIN */
describe ( 'makeNakedPromise', it => {
it ( 'returns a function which can be resolved from the outside', t => {
const {promise, resolve} = makeNakedPromise ();
promise.then ( t.pass );
resolve ();
});
it ( 'returns a function which can be rejected from the outside', t => {
const {promise, reject} = makeNakedPromise ();
promise.catch ( t.pass );
reject ();
});
it ( 'returns a function which can be used to check if the promise is pending, resolve branch', t => {
const {resolve, isPending} = makeNakedPromise ();
t.true ( isPending () );
resolve ();
t.false ( isPending () );
});
it ( 'returns a function which can be used to check if the promise is pending, reject branch', t => {
const {promise, reject, isPending} = makeNakedPromise ();
promise.catch ( () => {} );
t.true ( isPending () );
reject ();
t.false ( isPending () );
});
it ( 'returns a function which can be used to check if the promise is resolved, resolve branch', t => {
const {resolve, isResolved} = makeNakedPromise ();
t.false ( isResolved () );
resolve ();
t.true ( isResolved () );
});
it ( 'returns a function which can be used to check if the promise is resolved, reject branch', t => {
const {promise, reject, isResolved} = makeNakedPromise ();
promise.catch ( () => {} );
t.false ( isResolved () );
reject ();
t.false ( isResolved () );
});
it ( 'returns a function which can be used to check if the promise is rejected, resolve branch', t => {
const {resolve, isRejected} = makeNakedPromise ();
t.false ( isRejected () );
resolve ();
t.false ( isRejected () );
});
it ( 'returns a function which can be used to check if the promise is rejected, reject branch', t => {
const {promise, reject, isRejected} = makeNakedPromise ();
promise.catch ( () => {} );
t.false ( isRejected () );
reject ();
t.true ( isRejected () );
});
});