Skip to content

Instantly share code, notes, and snippets.

@lorenzofox3
Last active January 24, 2020 11:36
Show Gist options
  • Save lorenzofox3/a8fe20b726038f4cb4519c8c224a8163 to your computer and use it in GitHub Desktop.
Save lorenzofox3/a8fe20b726038f4cb4519c8c224a8163 to your computer and use it in GitHub Desktop.
typescript setup example
{
"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"
},
"author": "",
"license": "ISC",
"devDependencies": {
"esm": "^3.2.25",
"typescript": "^3.6.3",
"zora": "^3.0.3"
}
}
import {test} from 'zora';
import square from './square';
test(`some test passing test`, t => {
t.eq(square(2), 4, `2 * 2 = 4`);
});
test(`some failing test`, t => {
t.eq(square(3), 8, `3 * 3 = 9`);
});
export default (x: number): number => x ** 2;
{
"compilerOptions": {
"lib": [
"esnext",
"dom"
],
"module": "esnext",
"moduleResolution": "node",
"target": "esnext",
"sourceMap": true,
"esModuleInterop": true
},
"exclude": [
"./node_modules"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment