-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommand.txt
More file actions
49 lines (38 loc) · 858 Bytes
/
Copy pathcommand.txt
File metadata and controls
49 lines (38 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
tsc//
tsc --init
.....and change
"target": "es6",
"outDir": "./dist",
"rootDir": "./src",
"moduleResolution": "node",
and you use only tsc without tsc myfile.ts
npm --init
npm i -D typescript ts-node nodemon node @types/node
....and change
package.json
"scripts": {
"start": "node dist/app.js",
"dev": "nodemon src/app.ts",
"build": "tsc -p ."
},
.....run code via
npm run dev
test in Jest https://itnext.io/testing-with-jest-in-typescript-cc1cd0095421
npm i -D jest ts-jest @types/jest
in tsconfig.json add ...
"include": [
"./src/**/*"
],
"exclude": [
"node_modules"
],
"compilerOptions": {
next instal
npm i -D jest ts-jest @types/jest
npx ts-jest config:init
cd ..
mkdir myfolder
new-item myfiles.ts or txt
code myfiles.ts
remove-item myfiles.ts
Rename-Item -path app.ts -NewName app.test.ts