generated from boneskull/boneskull-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
also update deps change API to launch tests as forked processes cleanup stack traces
- Loading branch information
Showing
6 changed files
with
1,702 additions
and
2,211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,27 @@ | ||
const assert = require('assert'); | ||
// @ts-ignore | ||
const pkg = require('packtester/package.json'); | ||
|
||
/** | ||
* @type {typeof assert.ok} | ||
*/ | ||
const ok = assert.ok; | ||
|
||
/** | ||
* @param {import('type-fest').PackageJson} pkg | ||
* @type {typeof import('../src/packtester')} | ||
*/ | ||
module.exports = async pkg => { | ||
/** | ||
* @type {typeof import('../src/packtester')} | ||
*/ | ||
let packtester; | ||
assert.doesNotThrow(() => { | ||
packtester = require(pkg.name); | ||
}, `could not require('${pkg.name}')`); | ||
let packtester; | ||
assert.doesNotThrow(() => { | ||
packtester = require(pkg.name); | ||
}, `could not require('${pkg.name}')`); | ||
|
||
ok( | ||
typeof packtester.packTest === 'function', | ||
'did not export "packTest" function' | ||
); | ||
ok( | ||
typeof packtester.packTest === 'function', | ||
'did not export "packTest" function' | ||
); | ||
|
||
assert.doesNotReject(import(pkg.name), `could not import('${pkg.name}')`); | ||
assert.doesNotReject(import(pkg.name), `could not import('${pkg.name}')`); | ||
|
||
assert.doesNotThrow(() => { | ||
require(`${pkg.name}/${pkg.main}`); | ||
}, `could not require('${pkg.name}/${pkg.main}') directly`); | ||
}; | ||
assert.doesNotThrow(() => { | ||
require(`${pkg.name}/${pkg.main}`); | ||
}, `could not require('${pkg.name}/${pkg.main}') directly`); |
Oops, something went wrong.