-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathnode_snapshots.node.txt
41 lines (29 loc) · 1.99 KB
/
node_snapshots.node.txt
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
┏━━━━━━━━━━━━━━━━━━━━┓
┃ NODE_SNAPSHOTS ┃
┗━━━━━━━━━━━━━━━━━━━━┛
ALTERNATIVES ==> #See Jest snapshots
VERSION ==> #Part of Node.js core
--experimental
-test-snapshots <23.4.0*#Required
┌────────────────┐
│ ASSERTIONS │
└────────────────┘
T.assert.snapshot
(VAL[, SOPTS]) 22.3.0*#Create a snapshot
┌───────────┐
│ FILES │
└───────────┘
--test-update-snapshots 22.3.0*#When snapshot !==, update it instead
snapshot 22.3.0*#Where snapshot file is stored
.setResolveSnapshotPath 22.3.0*#'PATH' is current file (undefined if REPL)
(FUNC('PATH'|undefined) 22.3.0*#'PATH2' is output
->'PATH2') 22.3.0*#By default, it uses PATH.snapshot
T.assert.fileSnapshot 22.14.0*#Same as T.assert.snapshot() but specifies 'PATH'
(VAL, 'PATH'[, SOPTS]) 22.14.0*#'PATH' can only be used for a single assertion
┌────────────────┐
│ SERIALIZER │
└────────────────┘
snapshot.setDefault 22.3.0*#Customize serialization of snapshotted VAL. Last return value must be STR
SnapshotSerializers 22.3.0*#Def: JSON.stringify(VAL, null, 2)
(ARR of FUNC(OBJ)->VAL) 22.3.0*#Snapshot file is CommonJS exports, where key is T.fullName and value is serialized VAL
SOPTS.serializers 22.3.0*#FUNC_ARR. Same