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
import test from 'ava'; | |
import {Bar, Foo, monkeyPatched, objWithPrototype, simpleObj} from './tested.js'; | |
test(`native custom type(date)`, (t) => { | |
t.deepEqual( | |
{prop: new Date('2222-01-01T00:00:00.000Z')}, | |
{prop: '2222-01-01T00:00:00.000Z'} | |
); | |
}); |
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
{ | |
"name": "zora-coverage", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "ts-node sum.spec.ts", | |
"test:only": "RUN_ONLY=true ts-node sum.spec.ts", | |
"test:coverage": "c8 --exclude to-be-excluded.ts ts-node sum.spec.ts", | |
"dev": "nodemon sum.spec.ts" |
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
import {createService} from './movies-service.js'; | |
export default async (instance) => { | |
const {Movie} = instance; // mongoose model injected | |
instance.register(async (instance) => { | |
// we overwrite for the scope by our service instead | |
instance.decorate('Movie', createService({model: Movie})); | |
instance.register(routesPlugin); | |
}); | |
} |
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
{ | |
"name": "pta-ts", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "ts-node ./node_modules/.bin/pta ./test.ts" | |
}, | |
"author": "", | |
"license": "ISC", |
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
const {test} = require(`zora`); | |
const memoize = require(`lodash/memoize.js`); | |
let callCount = 0; | |
const wait = (time = 200) => new Promise((resolve) => { | |
setTimeout(() => resolve(), time); | |
}); | |
const fetchRemoteResource = memoize(async () => { |
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
Show hidden characters
{ | |
"sourceMaps": 'inline', | |
"presets": [ | |
"@babel/preset-react" | |
] | |
} |
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
module.exports = testResult => { | |
const isFailed = testResult.pass === false; | |
console.log(`${!isFailed ? 'ok' : 'no ok'} - ${testResult.description}`); | |
if (testResult.error) { | |
console.log(testResult.error.stack); | |
if (testResult.error.operator) { | |
console.log(`operator: ${testResult.error.operator}`); | |
} | |
if (testResult.error.expected) { | |
console.log(`expected: \n ${JSON.stringify(testResult.error.expected, null, 4)}`); |
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
#!/usr/bin/env node | |
const path = require('path'); | |
const {Console} = require('console'); | |
const globby = require('globby'); | |
const zora = require('zora'); | |
const TSR = require('tap-mocha-reporter'); | |
const {createHarness, mochaTapLike} = zora; | |
const DEFAULT_PATH = ['*.spec.js', './test/*.js']; |
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
import {report} from './tester.js'; | |
report(); |
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
{ | |
"name": "typescript-setup", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"compile": "tsc", | |
"test": "node -r esm ./spec.js", | |
"dev": "npm run compile -- -w" | |
}, |
NewerOlder