test-filesystem 1.1.2 → 1.3.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.
Files changed (68) hide show
  1. package/README.md +17 -0
  2. package/browser/test-fs.js +327 -349
  3. package/browser/test-fs.min.js +1 -1
  4. package/dist/functions/circularObject.d.ts +0 -1
  5. package/dist/functions/circularObject.js +1 -2
  6. package/dist/functions/circularObject.min.js +1 -1
  7. package/dist/functions/circularObject.min.mjs +1 -1
  8. package/dist/functions/circularObject.mjs +0 -1
  9. package/dist/functions/countMatches.d.ts +0 -1
  10. package/dist/functions/countMatches.js +1 -2
  11. package/dist/functions/countMatches.min.js +1 -1
  12. package/dist/functions/countMatches.min.mjs +1 -1
  13. package/dist/functions/countMatches.mjs +0 -1
  14. package/dist/functions/deepReferenceObject.d.ts +0 -1
  15. package/dist/functions/deepReferenceObject.js +1 -2
  16. package/dist/functions/deepReferenceObject.min.js +1 -1
  17. package/dist/functions/deepReferenceObject.min.mjs +1 -1
  18. package/dist/functions/deepReferenceObject.mjs +0 -1
  19. package/dist/functions/domItem.d.ts +0 -1
  20. package/dist/functions/domItem.js +1 -2
  21. package/dist/functions/domItem.min.js +1 -1
  22. package/dist/functions/domItem.min.mjs +1 -1
  23. package/dist/functions/domItem.mjs +0 -1
  24. package/dist/functions/fileExists.d.ts +7 -0
  25. package/dist/functions/fileExists.js +22 -0
  26. package/dist/functions/fileExists.min.js +1 -0
  27. package/dist/functions/fileExists.min.mjs +1 -0
  28. package/dist/functions/fileExists.mjs +15 -0
  29. package/dist/functions/jsonDom.d.ts +0 -1
  30. package/dist/functions/jsonDom.js +1 -2
  31. package/dist/functions/jsonDom.min.js +1 -1
  32. package/dist/functions/jsonDom.min.mjs +1 -1
  33. package/dist/functions/jsonDom.mjs +0 -1
  34. package/dist/functions/linkedList.d.ts +0 -1
  35. package/dist/functions/linkedList.js +1 -2
  36. package/dist/functions/linkedList.min.js +1 -1
  37. package/dist/functions/linkedList.min.mjs +1 -1
  38. package/dist/functions/linkedList.mjs +0 -1
  39. package/dist/functions/logObject.d.ts +0 -1
  40. package/dist/functions/logObject.js +1 -2
  41. package/dist/functions/logObject.min.js +1 -1
  42. package/dist/functions/logObject.min.mjs +1 -1
  43. package/dist/functions/logObject.mjs +0 -1
  44. package/dist/functions/multiReferenceObject.d.ts +0 -1
  45. package/dist/functions/multiReferenceObject.js +1 -2
  46. package/dist/functions/multiReferenceObject.min.js +1 -1
  47. package/dist/functions/multiReferenceObject.min.mjs +1 -1
  48. package/dist/functions/multiReferenceObject.mjs +0 -1
  49. package/dist/functions/nodeTree.d.ts +0 -1
  50. package/dist/functions/nodeTree.js +1 -2
  51. package/dist/functions/nodeTree.min.js +1 -1
  52. package/dist/functions/nodeTree.min.mjs +1 -1
  53. package/dist/functions/nodeTree.mjs +0 -1
  54. package/dist/functions/removeDirectory.d.ts +0 -1
  55. package/dist/functions/removeDirectory.js +1 -2
  56. package/dist/functions/removeDirectory.min.js +1 -1
  57. package/dist/functions/removeDirectory.min.mjs +1 -1
  58. package/dist/functions/removeDirectory.mjs +0 -1
  59. package/dist/functions/setUp.js +4 -4
  60. package/dist/functions/setUp.min.js +1 -1
  61. package/dist/functions/setUp.min.mjs +1 -1
  62. package/dist/functions/setUp.mjs +4 -3
  63. package/dist/main.d.ts +2 -1
  64. package/dist/main.js +45 -36
  65. package/dist/main.min.js +1 -1
  66. package/dist/main.min.mjs +1 -1
  67. package/dist/main.mjs +14 -12
  68. package/package.json +1 -1
package/README.md CHANGED
@@ -6,6 +6,11 @@ There are three options for accessing these functions:
6
6
  2. ES6 modules: dist/*.mjs
7
7
  3. Bundles Browser file: browser/test-fs.js
8
8
 
9
+ ## Installation
10
+
11
+ In your project's root directory, run: `npm install --save-dev test-filesystem`
12
+ (or `yarn add --dev test-filesystem` if you use Yarn).
13
+
9
14
  ## Usage
10
15
  To use the temporary directory in tests. Do the following in your tests:
11
16
  ```js
@@ -58,6 +63,7 @@ An assortment of objects that can be used in tests and some functions to help de
58
63
  * [.exports.createTempDir()](#module_test-fs.exports.createTempDir) ⇒ <code>Promise.&lt;(\*\|void)&gt;</code>
59
64
  * [.removeDirectory(dirPath)](#module_test-fs.removeDirectory) ⇒ <code>Promise.&lt;\*&gt;</code>
60
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>
61
67
  * [.countMatches(content, search)](#module_test-fs.countMatches) ⇒ <code>number</code>
62
68
 
63
69
  <a name="module_test-fs.nodeTree"></a>
@@ -149,6 +155,17 @@ Log out an object in a nicely formatted way.
149
155
  | [label] | <code>string</code> | <code>&quot;logging&quot;</code> |
150
156
  | [outputType] | <code>string</code> | <code>&quot;log&quot;</code> |
151
157
 
158
+ <a name="module_test-fs.fileExists"></a>
159
+
160
+ ### test-fs.fileExists(filePath) ⇒ <code>boolean</code>
161
+ Detect if a file exists and is usable.
162
+
163
+ **Kind**: static method of [<code>test-fs</code>](#module_test-fs)
164
+
165
+ | Param | Type |
166
+ | --- | --- |
167
+ | filePath | <code>string</code> |
168
+
152
169
  <a name="module_test-fs.countMatches"></a>
153
170
 
154
171
  ### test-fs.countMatches(content, search) ⇒ <code>number</code>