Skip to content

Commit dbb50b1

Browse files
committed
add --cache-directory test and docs
1 parent a100705 commit dbb50b1

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
### Yalc changelog
22

3-
## 1.0.0-pre.62 (2020-09-22)
3+
## 1.0.0-pre.63 (2020-09-22)
4+
5+
- fix --cache-directory flag
6+
7+
## 1.0.0-pre.62 (2020-08-22)
48

59
- fix child fork override
610

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Look up flags and options can be used [in ts-node's docs](https://github.com/Typ
5050
* `--exit-child` - Adds 'SIGTERM' exit handler in a child process.
5151
* `--rs` - Allow to restart with "rs" line entered in stdio, disabled by default.
5252
* `--notify` - to display desktop-notifications (Notifications are only displayed if `node-notifier` is installed).
53+
* `--cache-directory` - tmp dir which is used to keep the compiled sources
5354

5455
If you need to detect that you are running with `ts-node-dev`, check if `process.env.TS_NODE_DEV` is set.
5556

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ts-node-dev",
3-
"version": "1.0.0-pre.62",
3+
"version": "1.0.0-pre.63",
44
"description": "Compiles your TS app and restarts when files are modified.",
55
"keywords": [
66
"restart",

test/tsnd.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,4 +336,14 @@ describe('ts-node-dev', function () {
336336
await ps.exit()
337337
t.ok(true)
338338
})
339+
340+
it('should put compiled sources in custom --cache-directory', async () => {
341+
const cacheDir = join(tmpDir, 'test-cached-dir')
342+
fs.removeSync(cacheDir)
343+
const ps = spawnTsNodeDev(`--cache-directory ${cacheDir} simple.ts`)
344+
await ps.waitForLine(/v1/)
345+
await ps.exit()
346+
const list = fs.readdirSync(cacheDir)
347+
t.ok(list[0] === 'compiled', '"compiled" dir is there')
348+
})
339349
})

0 commit comments

Comments
 (0)