Last active
January 24, 2020 11:36
-
-
Save lorenzofox3/a8fe20b726038f4cb4519c8c224a8163 to your computer and use it in GitHub Desktop.
typescript setup example
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" | |
}, | |
"author": "", | |
"license": "ISC", | |
"devDependencies": { | |
"esm": "^3.2.25", | |
"typescript": "^3.6.3", | |
"zora": "^3.0.3" | |
} | |
} |
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 '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`); | |
}); |
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
export default (x: number): number => x ** 2; |
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
{ | |
"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