2020-06-15 22:15:37 +09:00
|
|
|
const assert = require('assert')
|
2020-05-12 14:59:20 +09:00
|
|
|
const testModule = require('./index.node')
|
|
|
|
|
|
|
|
function testSpawnThread(n) {
|
|
|
|
console.info('=== Test spawn task to threadpool')
|
|
|
|
return testModule.testSpawnThread(n)
|
|
|
|
}
|
|
|
|
|
|
|
|
testSpawnThread(20)
|
|
|
|
.then((value) => {
|
|
|
|
console.assert(value === 6765)
|
|
|
|
console.info('=== fibonacci result', value)
|
|
|
|
})
|
|
|
|
.catch((e) => {
|
|
|
|
console.error(e)
|
|
|
|
process.exit(1)
|
|
|
|
})
|
2020-06-15 22:15:37 +09:00
|
|
|
|
|
|
|
assert(testModule.testObjectIsDate({}) === false)
|
|
|
|
assert(testModule.testObjectIsDate(new Date()) === true)
|