test-filesystem 1.3.7 → 1.3.8
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 +61 -61
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -51,37 +51,37 @@ An assortment of objects that can be used in tests and some functions to help de
|
|
|
51
51
|
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
52
52
|
|
|
53
53
|
* [test-fs](#module_test-fs)
|
|
54
|
-
* [.circularObject](#module_test-fs.circularObject) : <code>Object.<string, (string\|Object\|Array)></code>
|
|
55
|
-
* [.deepReferenceObject](#module_test-fs.deepReferenceObject) : <code>Object.<string, (string\|number\|Object)></code>
|
|
56
|
-
* [.domItem](#module_test-fs.domItem) : <code>Object.<string, (string\|number\|Array\|Object)></code>
|
|
57
|
-
* [.jsonDom](#module_test-fs.jsonDom) : <code>Object.<string, (string\|number\|Array\|Object)></code>
|
|
58
|
-
* [.linkedList](#module_test-fs.linkedList) : <code>Object.<string, (string\|Object)></code>
|
|
59
|
-
* [.multiReferenceObject](#module_test-fs.multiReferenceObject) : <code>Object.<string, (string\|number\|Object)></code>
|
|
60
54
|
* [.nodeTree](#module_test-fs.nodeTree) : <code>Object.<string, (string\|Object\|Array)></code>
|
|
61
|
-
* [.
|
|
62
|
-
* [.
|
|
63
|
-
* [.
|
|
64
|
-
* [.
|
|
55
|
+
* [.multiReferenceObject](#module_test-fs.multiReferenceObject) : <code>Object.<string, (string\|number\|Object)></code>
|
|
56
|
+
* [.linkedList](#module_test-fs.linkedList) : <code>Object.<string, (string\|Object)></code>
|
|
57
|
+
* [.jsonDom](#module_test-fs.jsonDom) : <code>Object.<string, (string\|number\|Array\|Object)></code>
|
|
58
|
+
* [.domItem](#module_test-fs.domItem) : <code>Object.<string, (string\|number\|Array\|Object)></code>
|
|
59
|
+
* [.deepReferenceObject](#module_test-fs.deepReferenceObject) : <code>Object.<string, (string\|number\|Object)></code>
|
|
60
|
+
* [.circularObject](#module_test-fs.circularObject) : <code>Object.<string, (string\|Object\|Array)></code>
|
|
65
61
|
* [.afterEach()](#module_test-fs.afterEach) ⇒ <code>Promise.<\*></code>
|
|
66
62
|
* [.exports.afterEach([exists])](#module_test-fs.exports.afterEach) ⇒ <code>Promise.<(\*\|void)></code>
|
|
67
63
|
* [.exports.createTempDir()](#module_test-fs.exports.createTempDir) ⇒ <code>Promise.<(\*\|void)></code>
|
|
64
|
+
* [.removeDirectory(dirPath)](#module_test-fs.removeDirectory) ⇒ <code>Promise.<\*></code>
|
|
65
|
+
* [.logObject(object, [label], [outputType])](#module_test-fs.logObject) ⇒ <code>string</code> \| <code>undefined</code>
|
|
66
|
+
* [.fileExists(filePath)](#module_test-fs.fileExists) ⇒ <code>boolean</code>
|
|
67
|
+
* [.countMatches(content, search)](#module_test-fs.countMatches) ⇒ <code>number</code>
|
|
68
68
|
|
|
69
|
-
<a name="module_test-fs.
|
|
69
|
+
<a name="module_test-fs.nodeTree"></a>
|
|
70
70
|
|
|
71
|
-
### test-fs.
|
|
72
|
-
|
|
71
|
+
### test-fs.nodeTree : <code>Object.<string, (string\|Object\|Array)></code>
|
|
72
|
+
Sample NodeTree for testing circular references and arrays.
|
|
73
73
|
|
|
74
74
|
**Kind**: static constant of [<code>test-fs</code>](#module_test-fs)
|
|
75
|
-
<a name="module_test-fs.
|
|
75
|
+
<a name="module_test-fs.multiReferenceObject"></a>
|
|
76
76
|
|
|
77
|
-
### test-fs.
|
|
78
|
-
Sample object
|
|
77
|
+
### test-fs.multiReferenceObject : <code>Object.<string, (string\|number\|Object)></code>
|
|
78
|
+
Sample of an object containing multiple references.
|
|
79
79
|
|
|
80
80
|
**Kind**: static constant of [<code>test-fs</code>](#module_test-fs)
|
|
81
|
-
<a name="module_test-fs.
|
|
81
|
+
<a name="module_test-fs.linkedList"></a>
|
|
82
82
|
|
|
83
|
-
### test-fs.
|
|
84
|
-
Sample
|
|
83
|
+
### test-fs.linkedList : <code>Object.<string, (string\|Object)></code>
|
|
84
|
+
Sample LinkedList for testing circular references.
|
|
85
85
|
|
|
86
86
|
**Kind**: static constant of [<code>test-fs</code>](#module_test-fs)
|
|
87
87
|
<a name="module_test-fs.jsonDom"></a>
|
|
@@ -90,46 +90,57 @@ Sample of domItem child with nested child and optional details
|
|
|
90
90
|
Sample of jsonDom object containing an empty nested array and objects
|
|
91
91
|
|
|
92
92
|
**Kind**: static constant of [<code>test-fs</code>](#module_test-fs)
|
|
93
|
-
<a name="module_test-fs.
|
|
93
|
+
<a name="module_test-fs.domItem"></a>
|
|
94
94
|
|
|
95
|
-
### test-fs.
|
|
96
|
-
Sample
|
|
95
|
+
### test-fs.domItem : <code>Object.<string, (string\|number\|Array\|Object)></code>
|
|
96
|
+
Sample of domItem child with nested child and optional details
|
|
97
97
|
|
|
98
98
|
**Kind**: static constant of [<code>test-fs</code>](#module_test-fs)
|
|
99
|
-
<a name="module_test-fs.
|
|
99
|
+
<a name="module_test-fs.deepReferenceObject"></a>
|
|
100
100
|
|
|
101
|
-
### test-fs.
|
|
102
|
-
Sample
|
|
101
|
+
### test-fs.deepReferenceObject : <code>Object.<string, (string\|number\|Object)></code>
|
|
102
|
+
Sample object with deep references.
|
|
103
103
|
|
|
104
104
|
**Kind**: static constant of [<code>test-fs</code>](#module_test-fs)
|
|
105
|
-
<a name="module_test-fs.
|
|
105
|
+
<a name="module_test-fs.circularObject"></a>
|
|
106
106
|
|
|
107
|
-
### test-fs.
|
|
108
|
-
|
|
107
|
+
### test-fs.circularObject : <code>Object.<string, (string\|Object\|Array)></code>
|
|
108
|
+
Multilayered node tree-like structure with parent references
|
|
109
109
|
|
|
110
110
|
**Kind**: static constant of [<code>test-fs</code>](#module_test-fs)
|
|
111
|
-
<a name="module_test-fs.
|
|
111
|
+
<a name="module_test-fs.afterEach"></a>
|
|
112
112
|
|
|
113
|
-
### test-fs.
|
|
114
|
-
|
|
113
|
+
### test-fs.afterEach() ⇒ <code>Promise.<\*></code>
|
|
114
|
+
In the Jest.afterEach function call this one to clean up and remove the temp directory.
|
|
115
115
|
|
|
116
116
|
**Kind**: static method of [<code>test-fs</code>](#module_test-fs)
|
|
117
|
+
<a name="module_test-fs.exports.afterEach"></a>
|
|
117
118
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
| content | <code>string</code> |
|
|
121
|
-
| search | <code>string</code> |
|
|
119
|
+
### test-fs.exports.afterEach([exists]) ⇒ <code>Promise.<(\*\|void)></code>
|
|
120
|
+
Ensure that the del has completed, recursively attempt to delete and recreate
|
|
122
121
|
|
|
123
|
-
<
|
|
122
|
+
**Kind**: static method of [<code>test-fs</code>](#module_test-fs)
|
|
124
123
|
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
| Param | Type | Default |
|
|
125
|
+
| --- | --- | --- |
|
|
126
|
+
| [exists] | <code>boolean</code> | <code>true</code> |
|
|
127
|
+
|
|
128
|
+
<a name="module_test-fs.exports.createTempDir"></a>
|
|
129
|
+
|
|
130
|
+
### test-fs.exports.createTempDir() ⇒ <code>Promise.<(\*\|void)></code>
|
|
131
|
+
In the Jest.beforeEach function call this one to set up the temp directory.
|
|
132
|
+
|
|
133
|
+
**Kind**: static method of [<code>test-fs</code>](#module_test-fs)
|
|
134
|
+
<a name="module_test-fs.removeDirectory"></a>
|
|
135
|
+
|
|
136
|
+
### test-fs.removeDirectory(dirPath) ⇒ <code>Promise.<\*></code>
|
|
137
|
+
Return a promise to be completed once the specified directory is deleted.
|
|
127
138
|
|
|
128
139
|
**Kind**: static method of [<code>test-fs</code>](#module_test-fs)
|
|
129
140
|
|
|
130
141
|
| Param | Type |
|
|
131
142
|
| --- | --- |
|
|
132
|
-
|
|
|
143
|
+
| dirPath | <code>string</code> |
|
|
133
144
|
|
|
134
145
|
<a name="module_test-fs.logObject"></a>
|
|
135
146
|
|
|
@@ -144,37 +155,26 @@ Log out an object in a nicely formatted way.
|
|
|
144
155
|
| [label] | <code>string</code> | <code>"logging"</code> |
|
|
145
156
|
| [outputType] | <code>string</code> | <code>"log"</code> |
|
|
146
157
|
|
|
147
|
-
<a name="module_test-fs.
|
|
158
|
+
<a name="module_test-fs.fileExists"></a>
|
|
148
159
|
|
|
149
|
-
### test-fs.
|
|
150
|
-
|
|
160
|
+
### test-fs.fileExists(filePath) ⇒ <code>boolean</code>
|
|
161
|
+
Detect if a file exists and is usable.
|
|
151
162
|
|
|
152
163
|
**Kind**: static method of [<code>test-fs</code>](#module_test-fs)
|
|
153
164
|
|
|
154
165
|
| Param | Type |
|
|
155
166
|
| --- | --- |
|
|
156
|
-
|
|
|
157
|
-
|
|
158
|
-
<a name="module_test-fs.afterEach"></a>
|
|
159
|
-
|
|
160
|
-
### test-fs.afterEach() ⇒ <code>Promise.<\*></code>
|
|
161
|
-
In the Jest.afterEach function call this one to clean up and remove the temp directory.
|
|
167
|
+
| filePath | <code>string</code> |
|
|
162
168
|
|
|
163
|
-
|
|
164
|
-
<a name="module_test-fs.exports.afterEach"></a>
|
|
169
|
+
<a name="module_test-fs.countMatches"></a>
|
|
165
170
|
|
|
166
|
-
### test-fs.
|
|
167
|
-
|
|
171
|
+
### test-fs.countMatches(content, search) ⇒ <code>number</code>
|
|
172
|
+
Simple way to count string occurrences for testing.
|
|
168
173
|
|
|
169
174
|
**Kind**: static method of [<code>test-fs</code>](#module_test-fs)
|
|
170
175
|
|
|
171
|
-
| Param | Type |
|
|
172
|
-
| --- | --- |
|
|
173
|
-
|
|
|
174
|
-
|
|
175
|
-
<a name="module_test-fs.exports.createTempDir"></a>
|
|
176
|
-
|
|
177
|
-
### test-fs.exports.createTempDir() ⇒ <code>Promise.<(\*\|void)></code>
|
|
178
|
-
In the Jest.beforeEach function call this one to set up the temp directory.
|
|
176
|
+
| Param | Type |
|
|
177
|
+
| --- | --- |
|
|
178
|
+
| content | <code>string</code> |
|
|
179
|
+
| search | <code>string</code> |
|
|
179
180
|
|
|
180
|
-
**Kind**: static method of [<code>test-fs</code>](#module_test-fs)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "test-filesystem",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.8",
|
|
4
4
|
"description": "Set up and tear down a temp directory for running filesystem tests.",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"module": "./dist/main.mjs",
|
|
@@ -46,20 +46,20 @@
|
|
|
46
46
|
"vinyl-source-stream": "^2.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@babel/core": "^7.
|
|
50
|
-
"@babel/plugin-transform-modules-commonjs": "^7.
|
|
51
|
-
"@babel/preset-typescript": "^7.
|
|
52
|
-
"babel-jest": "^
|
|
49
|
+
"@babel/core": "^7.28.3",
|
|
50
|
+
"@babel/plugin-transform-modules-commonjs": "^7.27.1",
|
|
51
|
+
"@babel/preset-typescript": "^7.27.1",
|
|
52
|
+
"babel-jest": "^30.0.5",
|
|
53
53
|
"browserify": "^17.0.1",
|
|
54
|
-
"glob": "^11.0.
|
|
55
|
-
"gulp": "^5.0.
|
|
54
|
+
"glob": "^11.0.3",
|
|
55
|
+
"gulp": "^5.0.1",
|
|
56
56
|
"gulp-babel": "^8.0.0",
|
|
57
|
-
"gulp-rename": "^2.
|
|
57
|
+
"gulp-rename": "^2.1.0",
|
|
58
58
|
"gulp-standard": "^14.0.0",
|
|
59
59
|
"gulp-typescript": "^6.0.0-alpha.1",
|
|
60
60
|
"gulp-uglify-es": "^3.0.0",
|
|
61
|
-
"jest": "^
|
|
62
|
-
"jsdoc-to-markdown": "^9.
|
|
61
|
+
"jest": "^30.0.5",
|
|
62
|
+
"jsdoc-to-markdown": "^9.1.2",
|
|
63
63
|
"through2": "^4.0.2"
|
|
64
64
|
},
|
|
65
65
|
"engines": {
|