js-build-tools 2.4.0 → 3.0.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 (198) hide show
  1. package/README.md +334 -205
  2. package/dist/build.js +16 -5
  3. package/dist/build.min.js +1 -1
  4. package/dist/bundle.js +1 -2
  5. package/dist/bundle.min.js +1 -1
  6. package/dist/bundleLint.js +2 -3
  7. package/dist/bundleLint.min.js +1 -1
  8. package/dist/bundleMinify.js +1 -2
  9. package/dist/bundleMinify.min.js +1 -1
  10. package/dist/copyFonts.js +12 -0
  11. package/dist/copyFonts.min.js +1 -0
  12. package/dist/default.js +15 -15
  13. package/dist/default.min.js +1 -1
  14. package/dist/dist.js +7 -8
  15. package/dist/distLint.js +2 -3
  16. package/dist/distLint.min.js +1 -1
  17. package/dist/distMinify.js +1 -2
  18. package/dist/distMinify.min.js +1 -1
  19. package/dist/images.js +11 -0
  20. package/dist/images.min.js +1 -0
  21. package/dist/partials/addToReadme.js +2 -3
  22. package/dist/partials/beginWatcher.js +1 -2
  23. package/dist/partials/clean.js +10 -11
  24. package/dist/partials/copyFor.js +16 -0
  25. package/dist/partials/distFor.js +1 -2
  26. package/dist/partials/distForSrc.js +2 -3
  27. package/dist/partials/distSeries.js +3 -4
  28. package/dist/partials/imagesFor.js +34 -0
  29. package/dist/partials/minifyFor.js +15 -16
  30. package/dist/partials/readmeTemplate.js +1 -2
  31. package/dist/partials/removeDirectory.js +11 -12
  32. package/dist/partials/runOnChange.js +7 -7
  33. package/dist/partials/sassFor.js +2 -3
  34. package/dist/partials/tsFor.js +4 -5
  35. package/dist/partials.js +5 -1
  36. package/dist/partials.min.js +1 -1
  37. package/dist/test-helpers/setUp.js +31 -39
  38. package/dist/testFull.js +2 -3
  39. package/dist/testFull.min.js +1 -1
  40. package/dist/testHelpers.js +2 -20
  41. package/dist/testHelpers.min.js +1 -1
  42. package/dist/testQuick.js +1 -2
  43. package/dist/testQuick.min.js +1 -1
  44. package/dist/typeScript.js +7 -8
  45. package/dist/utilities/dotGet.js +50 -0
  46. package/dist/utilities/dotNotate.js +77 -0
  47. package/dist/utilities/dotSet.js +44 -0
  48. package/dist/utilities/isObject.js +10 -0
  49. package/dist/watchFull.js +10 -11
  50. package/dist/watchTest.js +1 -2
  51. package/dist/watchTest.min.js +1 -1
  52. package/functions/build.js +15 -5
  53. package/functions/build.test.js +278 -42
  54. package/functions/bundle.js +3 -4
  55. package/functions/bundle.test.js +6 -6
  56. package/functions/bundleLint.js +2 -3
  57. package/functions/bundleLint.test.js +5 -5
  58. package/functions/bundleMinify.js +1 -2
  59. package/functions/bundleMinify.test.js +1 -1
  60. package/functions/copyFonts.js +11 -0
  61. package/functions/copyFonts.test.js +31 -0
  62. package/functions/default.js +1 -1
  63. package/functions/default.test.js +2 -2
  64. package/functions/dist.js +0 -1
  65. package/functions/dist.test.js +1 -1
  66. package/functions/distLint.js +2 -3
  67. package/functions/distLint.test.js +3 -3
  68. package/functions/distMinify.js +1 -2
  69. package/functions/distMinify.test.js +1 -1
  70. package/functions/images.js +10 -0
  71. package/functions/images.test.js +138 -0
  72. package/functions/partials/addToReadme.js +2 -3
  73. package/functions/partials/addToReadme.test.js +2 -2
  74. package/functions/partials/beginWatcher.js +1 -2
  75. package/functions/partials/beginWatcher.test.js +1 -1
  76. package/functions/partials/clean.js +0 -1
  77. package/functions/partials/copyFor.js +13 -0
  78. package/functions/partials/copyFor.test.js +34 -0
  79. package/functions/partials/distFor.js +1 -2
  80. package/functions/partials/distFor.test.js +4 -4
  81. package/functions/partials/distForSrc.js +3 -4
  82. package/functions/partials/distForSrc.test.js +6 -6
  83. package/functions/partials/distSeries.js +2 -3
  84. package/functions/partials/distSeries.test.js +5 -5
  85. package/functions/partials/imagesFor.js +33 -0
  86. package/functions/partials/imagesFor.test.js +143 -0
  87. package/functions/partials/minifyFor.js +0 -1
  88. package/functions/partials/minifyFor.test.js +1 -1
  89. package/functions/partials/readmeTemplate.js +3 -4
  90. package/functions/partials/readmeTemplate.test.js +2 -2
  91. package/functions/partials/removeDirectory.js +0 -1
  92. package/functions/partials/runOnChange.js +5 -6
  93. package/functions/partials/runOnChange.test.js +9 -9
  94. package/functions/partials/sassFor.js +1 -2
  95. package/functions/partials/sassFor.test.js +3 -3
  96. package/functions/partials/tsFor.js +3 -4
  97. package/functions/partials/tsFor.test.js +2 -2
  98. package/functions/partials.js +5 -1
  99. package/functions/partials.test.js +1 -1
  100. package/functions/sass.test.js +2 -2
  101. package/functions/test-helpers/setUp.js +24 -32
  102. package/functions/testFull.js +2 -3
  103. package/functions/testFull.test.js +1 -1
  104. package/functions/testHelpers.js +3 -20
  105. package/functions/testHelpers.test.js +1 -1
  106. package/functions/testQuick.js +1 -2
  107. package/functions/testQuick.test.js +1 -1
  108. package/functions/typeScript.js +0 -1
  109. package/functions/typeScript.test.js +0 -2
  110. package/functions/utilities/dotGet.js +47 -0
  111. package/functions/utilities/dotNotate.js +68 -0
  112. package/functions/utilities/dotSet.js +41 -0
  113. package/functions/utilities/isObject.js +9 -0
  114. package/functions/watchFull.js +0 -1
  115. package/functions/watchFull.test.js +1 -1
  116. package/functions/watchTest.js +1 -2
  117. package/functions/watchTest.test.js +1 -1
  118. package/gulp.config.js +153 -79
  119. package/gulpfile.base.js +5 -1
  120. package/jsdoc.base.js +1 -1
  121. package/package.json +13 -9
  122. package/vendor/array-union/index.js +31 -0
  123. package/vendor/easy-transform-stream/index.js +58 -0
  124. package/vendor/globby/gitignore.js +100 -0
  125. package/vendor/globby/index.js +195 -0
  126. package/vendor/globby/node_modules/slash/index.js +16 -0
  127. package/vendor/globby/stream-utils.js +58 -0
  128. package/vendor/globby/to-path.js +20 -0
  129. package/vendor/gulp-imagemin/index.js +128 -0
  130. package/vendor/gulp-imagemin/node_modules/chalk/source/index.js +265 -0
  131. package/vendor/gulp-imagemin/node_modules/chalk/source/utilities.js +36 -0
  132. package/vendor/gulp-imagemin/node_modules/chalk/source/vendor/ansi-styles/index.js +217 -0
  133. package/vendor/gulp-imagemin/node_modules/chalk/source/vendor/supports-color/index.js +154 -0
  134. package/vendor/gulp-plugin-extras/index.js +46 -0
  135. package/vendor/gulp-plugin-extras/node_modules/chalk/source/index.js +265 -0
  136. package/vendor/gulp-plugin-extras/node_modules/chalk/source/utilities.js +36 -0
  137. package/vendor/gulp-plugin-extras/node_modules/chalk/source/vendor/ansi-styles/index.js +217 -0
  138. package/vendor/gulp-plugin-extras/node_modules/chalk/source/vendor/supports-color/index.js +154 -0
  139. package/vendor/gulp-plugin-extras/plugin-error.js +145 -0
  140. package/vendor/ignore/index.js +468 -0
  141. package/vendor/imagemin/index.js +94 -0
  142. package/vendor/imagemin-gifsicle/index.js +37 -0
  143. package/vendor/imagemin-mozjpeg/index.js +104 -0
  144. package/vendor/imagemin-mozjpeg/node_modules/execa/index.js +264 -0
  145. package/vendor/imagemin-mozjpeg/node_modules/execa/lib/command.js +47 -0
  146. package/vendor/imagemin-mozjpeg/node_modules/execa/lib/error.js +102 -0
  147. package/vendor/imagemin-mozjpeg/node_modules/execa/lib/kill.js +123 -0
  148. package/vendor/imagemin-mozjpeg/node_modules/execa/lib/promise.js +47 -0
  149. package/vendor/imagemin-mozjpeg/node_modules/execa/lib/stdio.js +50 -0
  150. package/vendor/imagemin-mozjpeg/node_modules/execa/lib/stream.js +128 -0
  151. package/vendor/imagemin-mozjpeg/node_modules/human-signals/build/src/core.js +238 -0
  152. package/vendor/imagemin-mozjpeg/node_modules/human-signals/build/src/main.js +89 -0
  153. package/vendor/imagemin-mozjpeg/node_modules/human-signals/build/src/realtime.js +24 -0
  154. package/vendor/imagemin-mozjpeg/node_modules/human-signals/build/src/signals.js +44 -0
  155. package/vendor/imagemin-mozjpeg/node_modules/is-stream/index.js +25 -0
  156. package/vendor/imagemin-mozjpeg/node_modules/mimic-fn/index.js +70 -0
  157. package/vendor/imagemin-mozjpeg/node_modules/npm-run-path/index.js +52 -0
  158. package/vendor/imagemin-mozjpeg/node_modules/onetime/index.js +43 -0
  159. package/vendor/imagemin-mozjpeg/node_modules/path-key/index.js +20 -0
  160. package/vendor/imagemin-mozjpeg/node_modules/strip-final-newline/index.js +17 -0
  161. package/vendor/imagemin-optipng/index.js +44 -0
  162. package/vendor/imagemin-svgo/index.js +27 -0
  163. package/vendor/is-jpg/index.js +12 -0
  164. package/vendor/junk/index.js +49 -0
  165. package/vendor/mozjpeg/index.js +9 -0
  166. package/vendor/mozjpeg/lib/index.js +18 -0
  167. package/vendor/mozjpeg/package.json +50 -0
  168. package/vendor/p-pipe/index.js +26 -0
  169. package/vendor/plur/index.js +32 -0
  170. package/vendor/pretty-bytes/index.js +71 -0
  171. package/vendor/slash/index.js +12 -0
  172. package/dist/test-helpers/circularObject.js +0 -50
  173. package/dist/test-helpers/countMatches.js +0 -12
  174. package/dist/test-helpers/deepReferenceObject.js +0 -20
  175. package/dist/test-helpers/domItem.js +0 -33
  176. package/dist/test-helpers/jsonDom.js +0 -20
  177. package/dist/test-helpers/linkedList.js +0 -23
  178. package/dist/test-helpers/logObject.js +0 -21
  179. package/dist/test-helpers/multiReferenceObject.js +0 -20
  180. package/dist/test-helpers/nodeTree.js +0 -28
  181. package/functions/test-helpers/circularObject.js +0 -28
  182. package/functions/test-helpers/circularObject.test.js +0 -14
  183. package/functions/test-helpers/countMatches.js +0 -11
  184. package/functions/test-helpers/countMatches.test.js +0 -9
  185. package/functions/test-helpers/deepReferenceObject.js +0 -25
  186. package/functions/test-helpers/deepReferenceObject.test.js +0 -7
  187. package/functions/test-helpers/domItem.js +0 -31
  188. package/functions/test-helpers/domItem.test.js +0 -12
  189. package/functions/test-helpers/jsonDom.js +0 -16
  190. package/functions/test-helpers/jsonDom.test.js +0 -12
  191. package/functions/test-helpers/linkedList.js +0 -10
  192. package/functions/test-helpers/linkedList.test.js +0 -22
  193. package/functions/test-helpers/logObject.js +0 -18
  194. package/functions/test-helpers/logObject.test.js +0 -20
  195. package/functions/test-helpers/multiReferenceObject.js +0 -25
  196. package/functions/test-helpers/multiReferenceObject.test.js +0 -14
  197. package/functions/test-helpers/nodeTree.js +0 -11
  198. package/functions/test-helpers/nodeTree.test.js +0 -18
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- /**
4
- * Log out an object in a nicely formatted way.
5
- * @function
6
- * @memberOf module:testHelpers
7
- * @param {Object} object
8
- * @param {string} [label=logging]
9
- * @param {string} [outputType=log]
10
- * @returns {string|undefined}
11
- */
12
- const logObject = function (object) {
13
- let label = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'logging';
14
- let outputType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'log';
15
- const logger = outputType === 'string' ? (label, object) => `'${label}' | ` + JSON.stringify(object) : console[outputType];
16
- if (typeof require === 'undefined' || outputType === 'string') {
17
- return logger(label, object);
18
- }
19
- return logger(label, require('util').inspect(object, false, null, true));
20
- };
21
- module.exports = logObject;
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- /**
4
- * Sample of object containing multiple references.
5
- * @memberOf module:testHelpers
6
- * @type {Object.<string, string|number|Object>}
7
- */
8
- const multiReferenceObject = {
9
- object1: {
10
- name: 'someName'
11
- },
12
- object2: {
13
- age: 12
14
- },
15
- array1: ['someString', 'anotherString'],
16
- array2: [89, 32],
17
- title: 'Some Title',
18
- item: 45
19
- };
20
- module.exports = multiReferenceObject;
@@ -1,28 +0,0 @@
1
- "use strict";
2
-
3
- /**
4
- * Sample NodeTree for testing circular references and arrays.
5
- * @memberOf module:testHelpers
6
- * @type {Object.<string, string|Object|Array>}
7
- */
8
- const nodeTree = {
9
- name: 'one',
10
- parent: null,
11
- children: []
12
- };
13
- nodeTree.children[0] = {
14
- name: 'child one',
15
- parent: nodeTree,
16
- children: []
17
- };
18
- nodeTree.children[1] = {
19
- name: 'child two',
20
- parent: nodeTree,
21
- children: []
22
- };
23
- nodeTree.children[0].children[0] = {
24
- name: 'grandchild one',
25
- parent: nodeTree.children[0],
26
- children: []
27
- };
28
- module.exports = nodeTree;
@@ -1,28 +0,0 @@
1
- /**
2
- * Multilayered node tree-like structure with parent references
3
- * @memberOf module:testHelpers
4
- * @type {Object.<string, string|Object|Array>}
5
- */
6
- const circularObject = { name: 'root', parent: {}, body: {}, head: {}, children: [] }
7
- circularObject.children = [
8
- { name: 'body', parent: {}, children: [] },
9
- { name: 'head', parent: {}, children: [] }
10
- ]
11
- circularObject.body = circularObject.children[0]
12
- circularObject.head = circularObject.children[1]
13
- circularObject.body.parent = circularObject
14
- circularObject.head.parent = circularObject
15
- circularObject.body.children = [
16
- { name: 'body child one', parent: {}, children: [] },
17
- { name: 'body child two', parent: {}, children: [] }
18
- ]
19
- circularObject.body.children[0].parent = circularObject.body
20
- circularObject.body.children[1].parent = circularObject.body
21
- circularObject.head.children = [
22
- { name: 'head child one', parent: {}, children: [] },
23
- { name: 'head child two', parent: {}, children: [] }
24
- ]
25
- circularObject.head.children[0].parent = circularObject.head
26
- circularObject.head.children[1].parent = circularObject.head
27
-
28
- module.exports = circularObject
@@ -1,14 +0,0 @@
1
- import circularObject from './circularObject'
2
-
3
- describe('circularObject', () => {
4
- test('has sample circular object', () => {
5
- expect(circularObject.body.parent).toBe(circularObject)
6
- expect(circularObject.body.children[0].parent).toBe(circularObject.body)
7
- expect(circularObject.body.children[1].parent).toBe(circularObject.body)
8
- expect(circularObject.children[0]).toBe(circularObject.body)
9
- expect(circularObject.head.parent).toBe(circularObject)
10
- expect(circularObject.head.children[0].parent).toBe(circularObject.head)
11
- expect(circularObject.head.children[1].parent).toBe(circularObject.head)
12
- expect(circularObject.children[1]).toBe(circularObject.head)
13
- })
14
- })
@@ -1,11 +0,0 @@
1
- /**
2
- * Simple way to count string occurrences for testing.
3
- * @function
4
- * @memberOf module:testHelpers
5
- * @param {string} content
6
- * @param {string} search
7
- * @returns {number}
8
- */
9
- const countMatches = (content, search) => content.split(search).length - 1
10
-
11
- module.exports = countMatches
@@ -1,9 +0,0 @@
1
- const countMatches = require('./countMatches')
2
-
3
- describe('countMatches', () => {
4
- test('can get count of string occurrences', () => {
5
- const find = 'find me'
6
- const sampleString = `${find} in some string that could change the times ${find} will occur here, ${find} should be found three times`
7
- expect(countMatches(sampleString, find)).toBe(3)
8
- })
9
- })
@@ -1,25 +0,0 @@
1
- /**
2
- * Sample object with deep references.
3
- * @memberOf module:testHelpers
4
- * @type {Object.<string, string|number|Object>}
5
- */
6
- const deepReferenceObject = {
7
- object1: {
8
- name: 'someName',
9
- object2: {
10
- age: 12,
11
- array1: [
12
- 'someString',
13
- 'anotherString'
14
- ]
15
- },
16
- array2: [
17
- 89,
18
- 32
19
- ]
20
- },
21
- title: 'Some Title',
22
- item: 45
23
- }
24
-
25
- module.exports = deepReferenceObject
@@ -1,7 +0,0 @@
1
- const deepReferenceObject = require('./deepReferenceObject')
2
-
3
- describe('deepReferenceObject', () => {
4
- test('has sample deep reference object', () => {
5
- expect(deepReferenceObject).toHaveProperty('object1.object2.array1')
6
- })
7
- })
@@ -1,31 +0,0 @@
1
- /**
2
- * Sample of domItem child with nested child and optional details
3
- * @memberOf module:testHelpers
4
- * @type {Object.<string, string|number|Array|Object>}
5
- */
6
- const domItem = [
7
- {
8
- attributes: { className: 'row', style: {} },
9
- axis: 'y',
10
- children: [
11
- {
12
- attributes: { style: {} },
13
- axis: 'x',
14
- children: [],
15
- element: {},
16
- eventListeners: {},
17
- hasShip: false,
18
- isHit: false,
19
- parentItem: {},
20
- point: {},
21
- tagName: 'div'
22
- }
23
- ],
24
- element: null,
25
- eventListeners: {},
26
- parentItem: {},
27
- tagName: 'div'
28
- }
29
- ]
30
-
31
- module.exports = domItem
@@ -1,12 +0,0 @@
1
- const domItem = require('./domItem')
2
-
3
- describe('domItem', () => {
4
- test('has sample domItem object', () => {
5
- expect(domItem[0]).toHaveProperty('attributes')
6
- expect(domItem[0]).toHaveProperty('children')
7
- expect(domItem[0]).toHaveProperty('element')
8
- expect(domItem[0]).toHaveProperty('eventListeners')
9
- expect(domItem[0]).toHaveProperty('parentItem')
10
- expect(domItem[0]).toHaveProperty('tagName')
11
- })
12
- })
@@ -1,16 +0,0 @@
1
- /**
2
- * Sample of jsonDom object containing empty nested array and objects
3
- * @memberOf module:testHelpers
4
- * @type {Object.<string, string|number|Array|Object>}
5
- */
6
- const jsonDom = {
7
- tagName: 'div',
8
- attributes: { style: {}, className: 'column' },
9
- element: null,
10
- eventListeners: {},
11
- parentItem: {},
12
- children: [],
13
- axis: 'x'
14
- }
15
-
16
- module.exports = jsonDom
@@ -1,12 +0,0 @@
1
- const jsonDom = require('./jsonDom')
2
-
3
- describe('jsonDom', () => {
4
- test('has sample jsonDom object', () => {
5
- expect(jsonDom).toHaveProperty('attributes')
6
- expect(jsonDom).toHaveProperty('children')
7
- expect(jsonDom).toHaveProperty('element')
8
- expect(jsonDom).toHaveProperty('eventListeners')
9
- expect(jsonDom).toHaveProperty('parentItem')
10
- expect(jsonDom).toHaveProperty('tagName')
11
- })
12
- })
@@ -1,10 +0,0 @@
1
- /**
2
- * Sample LinkedList for testing circular references.
3
- * @memberOf module:testHelpers
4
- * @type {Object.<string, string|Object>}
5
- */
6
- const linkedList = { name: 'one', prev: null, next: null }
7
- linkedList.next = { name: 'two', prev: linkedList, next: null }
8
- linkedList.next.next = { name: 'three', prev: linkedList.next, next: null }
9
-
10
- module.exports = linkedList
@@ -1,22 +0,0 @@
1
- const linkedList = require('./linkedList')
2
-
3
- describe('linkedList', () => {
4
- test('has sample linkedList object', () => {
5
- expect(linkedList.name).toBe('one')
6
- expect(linkedList).toHaveProperty('prev')
7
- expect(linkedList.prev).toBeNull()
8
-
9
- expect(linkedList).toHaveProperty('next')
10
- expect(linkedList.next.name).toBe('two')
11
- expect(linkedList).toHaveProperty('next.prev')
12
- expect(linkedList.next.prev).toBe(linkedList)
13
-
14
- expect(linkedList).toHaveProperty('next.next')
15
- expect(linkedList.next.next.name).toBe('three')
16
- expect(linkedList).toHaveProperty('next.prev')
17
- expect(linkedList.next.next.prev).toBe(linkedList.next)
18
-
19
- expect(linkedList).toHaveProperty('next.next.next')
20
- expect(linkedList.next.next.next).toBeNull()
21
- })
22
- })
@@ -1,18 +0,0 @@
1
- /**
2
- * Log out an object in a nicely formatted way.
3
- * @function
4
- * @memberOf module:testHelpers
5
- * @param {Object} object
6
- * @param {string} [label=logging]
7
- * @param {string} [outputType=log]
8
- * @returns {string|undefined}
9
- */
10
- const logObject = (object, label = 'logging', outputType = 'log') => {
11
- const logger = outputType === 'string' ? (label, object) => `'${label}' | ` + JSON.stringify(object) : console[outputType]
12
- if (typeof require === 'undefined' || outputType === 'string') {
13
- return logger(label, object)
14
- }
15
- return logger(label, require('util').inspect(object, false, null, true))
16
- }
17
-
18
- module.exports = logObject
@@ -1,20 +0,0 @@
1
- const logObject = require('./logObject')
2
- const util = require('util')
3
-
4
- describe('logObject', () => {
5
- test('can nicely output objects', () => {
6
- const logSpy = jest.spyOn(console, 'log').mockImplementation(jest.fn())
7
- const inspectSpy = jest.spyOn(util, 'inspect')
8
- const someObject = { one: 1, two: 2, three: 3 }
9
- logObject(someObject, 'someObject')
10
- expect(inspectSpy).toHaveBeenCalledWith(someObject, false, null, true)
11
- expect(logSpy).toHaveBeenCalledWith('someObject', util.inspect(someObject, false, null, true))
12
- })
13
-
14
- test('output to string when that argument is provided', () => {
15
- const someObject = { one: 1, two: 2, three: 3 }
16
- const label = 'someObject'
17
- const result = logObject(someObject, label, 'string')
18
- expect(result).toEqual(`'${label}' | ` + JSON.stringify(someObject))
19
- })
20
- })
@@ -1,25 +0,0 @@
1
- /**
2
- * Sample of object containing multiple references.
3
- * @memberOf module:testHelpers
4
- * @type {Object.<string, string|number|Object>}
5
- */
6
- const multiReferenceObject = {
7
- object1: {
8
- name: 'someName'
9
- },
10
- object2: {
11
- age: 12
12
- },
13
- array1: [
14
- 'someString',
15
- 'anotherString'
16
- ],
17
- array2: [
18
- 89,
19
- 32
20
- ],
21
- title: 'Some Title',
22
- item: 45
23
- }
24
-
25
- module.exports = multiReferenceObject
@@ -1,14 +0,0 @@
1
- const multiReferenceObject = require('./multiReferenceObject')
2
-
3
- describe('multiReferenceObject', () => {
4
- test('has sample multiReferenceObject object', () => {
5
- expect(multiReferenceObject).toHaveProperty('object1.name')
6
- expect(multiReferenceObject).toHaveProperty('object2.age')
7
- expect(multiReferenceObject).toHaveProperty('array1.0')
8
- expect(multiReferenceObject).toHaveProperty('array1.1')
9
- expect(multiReferenceObject).toHaveProperty('array2.0')
10
- expect(multiReferenceObject).toHaveProperty('array2.1')
11
- expect(multiReferenceObject).toHaveProperty('title')
12
- expect(multiReferenceObject).toHaveProperty('item')
13
- })
14
- })
@@ -1,11 +0,0 @@
1
- /**
2
- * Sample NodeTree for testing circular references and arrays.
3
- * @memberOf module:testHelpers
4
- * @type {Object.<string, string|Object|Array>}
5
- */
6
- const nodeTree = { name: 'one', parent: null, children: [] }
7
- nodeTree.children[0] = { name: 'child one', parent: nodeTree, children: [] }
8
- nodeTree.children[1] = { name: 'child two', parent: nodeTree, children: [] }
9
- nodeTree.children[0].children[0] = { name: 'grandchild one', parent: nodeTree.children[0], children: [] }
10
-
11
- module.exports = nodeTree
@@ -1,18 +0,0 @@
1
- import nodeTree from './nodeTree'
2
-
3
- describe('nodeTree', () => {
4
- test('has sample nodeTree object', () => {
5
- expect(nodeTree.name).toBe('one')
6
- expect(nodeTree.parent).toBeNull()
7
- expect(nodeTree.children.length).toBe(2)
8
- expect(nodeTree.children[0].name).toBe('child one')
9
- expect(nodeTree.children[0].parent).toBe(nodeTree)
10
- expect(nodeTree.children[0].children.length).toBe(1)
11
- expect(nodeTree.children[0].children[0].name).toBe('grandchild one')
12
- expect(nodeTree.children[0].children[0].parent).toBe(nodeTree.children[0])
13
- expect(nodeTree.children[0].children[0].children.length).toBe(0)
14
- expect(nodeTree.children[1].name).toBe('child two')
15
- expect(nodeTree.children[1].parent).toBe(nodeTree)
16
- expect(nodeTree.children[1].children.length).toBe(0)
17
- })
18
- })