fs-fixture 2.13.0 → 2.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/package.json +1 -1
- package/skills/fs-fixture/SKILL.md +18 -0
package/README.md
CHANGED
|
@@ -186,6 +186,24 @@ const fixture = await createFixture({
|
|
|
186
186
|
})
|
|
187
187
|
```
|
|
188
188
|
|
|
189
|
+
> [!TIP]
|
|
190
|
+
> Path syntax also works for grouped prefixes, so you can keep related files together without repeating the shared path:
|
|
191
|
+
>
|
|
192
|
+
> ```ts
|
|
193
|
+
> await createFixture({
|
|
194
|
+
> 'file.js': 'import { a } from "my-pkg";',
|
|
195
|
+
>
|
|
196
|
+
> 'node_modules/my-pkg': {
|
|
197
|
+
> 'package.json': JSON.stringify({
|
|
198
|
+
> name: 'my-pkg',
|
|
199
|
+
> type: 'module',
|
|
200
|
+
> exports: './index.js'
|
|
201
|
+
> }),
|
|
202
|
+
> 'index.js': 'export const a = 1;'
|
|
203
|
+
> }
|
|
204
|
+
> })
|
|
205
|
+
> ```
|
|
206
|
+
|
|
189
207
|
### Custom filesystem
|
|
190
208
|
|
|
191
209
|
Pass any `fs/promises`-compatible API via the `fs` option to use a virtual filesystem instead of disk:
|
package/package.json
CHANGED
|
@@ -72,6 +72,24 @@ Path syntax — these are equivalent:
|
|
|
72
72
|
{ 'src/utils/helper.js': 'code' }
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
+
> [!TIP]
|
|
76
|
+
> Slash-separated keys can also group a shared prefix:
|
|
77
|
+
>
|
|
78
|
+
> ```ts
|
|
79
|
+
> await createFixture({
|
|
80
|
+
> 'file.js': 'import { a } from "my-pkg";',
|
|
81
|
+
>
|
|
82
|
+
> 'node_modules/my-pkg': {
|
|
83
|
+
> 'package.json': JSON.stringify({
|
|
84
|
+
> name: 'my-pkg',
|
|
85
|
+
> type: 'module',
|
|
86
|
+
> exports: './index.js'
|
|
87
|
+
> }),
|
|
88
|
+
> 'index.js': 'export const a = 1;'
|
|
89
|
+
> }
|
|
90
|
+
> })
|
|
91
|
+
> ```
|
|
92
|
+
|
|
75
93
|
## Patterns
|
|
76
94
|
|
|
77
95
|
### Symlinks
|