feat: pass space data as an object to the save components to files ac… #35
Annotations
10 errors
src/commands/components/actions.test.ts > pull components actions > saveComponentsToFiles > should save components to files successfully:
src/utils/error/filesystem-error.ts#L51
File System Error: An unknown error occurred
❯ Module.handleFileSystemError src/utils/error/filesystem-error.ts:51:11
❯ Module.saveComponentsToFiles src/commands/components/actions.ts:167:5
❯ src/commands/components/actions.test.ts:101:7
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errorId: 'unknown_error', code: undefined, messageStack: [ 'Writing file', 'An unknown error occurred' ], error: { stack: 'TypeError: Cannot read properties of undefined (reading \'length\')\n at Module.saveComponentsToFiles (/home/runner/work/storyblok-cli/storyblok-cli/src/commands/components/actions.ts:156:16)\n at /home/runner/work/storyblok-cli/storyblok-cli/src/commands/components/actions.test.ts:101:7\n at file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:529:5\n at runTest (file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:982:11)\n at runSuite (file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:1131:15)\n at runSuite (file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:1131:15)\n at runSuite (file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:1131:15)\n at runFiles (file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:1188:5)\n at startTests (file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:1197:3)\n at file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]_/node_modules/vitest/dist/chunks/runBaseTests.9YDrdSI4.js:130:11', message: 'Cannot read properties of undefined (reading \'length\')', constructor: 'Function<TypeError>', name: 'TypeError', toString: 'Function<toString>' }, getInfo: 'Function<getInfo>' }
|
src/commands/components/actions.test.ts > pull components actions > saveComponentsToFiles > should save components to files with custom filename:
src/utils/error/filesystem-error.ts#L51
File System Error: An unknown error occurred
❯ Module.handleFileSystemError src/utils/error/filesystem-error.ts:51:11
❯ Module.saveComponentsToFiles src/commands/components/actions.ts:167:5
❯ src/commands/components/actions.test.ts:124:7
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errorId: 'unknown_error', code: undefined, messageStack: [ 'Writing file', 'An unknown error occurred' ], error: { stack: 'TypeError: Cannot read properties of undefined (reading \'length\')\n at Module.saveComponentsToFiles (/home/runner/work/storyblok-cli/storyblok-cli/src/commands/components/actions.ts:156:16)\n at /home/runner/work/storyblok-cli/storyblok-cli/src/commands/components/actions.test.ts:124:7\n at file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:529:5\n at runTest (file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:982:11)\n at runSuite (file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:1131:15)\n at runSuite (file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:1131:15)\n at runSuite (file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:1131:15)\n at runFiles (file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:1188:5)\n at startTests (file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:1197:3)\n at file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]_/node_modules/vitest/dist/chunks/runBaseTests.9YDrdSI4.js:130:11', message: 'Cannot read properties of undefined (reading \'length\')', constructor: 'Function<TypeError>', name: 'TypeError', toString: 'Function<toString>' }, getInfo: 'Function<getInfo>' }
|
src/commands/components/actions.test.ts > pull components actions > saveComponentsToFiles > should save components to files with custom suffix:
src/utils/error/filesystem-error.ts#L51
File System Error: An unknown error occurred
❯ Module.handleFileSystemError src/utils/error/filesystem-error.ts:51:11
❯ Module.saveComponentsToFiles src/commands/components/actions.ts:167:5
❯ src/commands/components/actions.test.ts:147:7
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errorId: 'unknown_error', code: undefined, messageStack: [ 'Writing file', 'An unknown error occurred' ], error: { stack: 'TypeError: Cannot read properties of undefined (reading \'length\')\n at Module.saveComponentsToFiles (/home/runner/work/storyblok-cli/storyblok-cli/src/commands/components/actions.ts:156:16)\n at /home/runner/work/storyblok-cli/storyblok-cli/src/commands/components/actions.test.ts:147:7\n at file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:529:5\n at runTest (file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:982:11)\n at runSuite (file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:1131:15)\n at runSuite (file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:1131:15)\n at runSuite (file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:1131:15)\n at runFiles (file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:1188:5)\n at startTests (file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:1197:3)\n at file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]_/node_modules/vitest/dist/chunks/runBaseTests.9YDrdSI4.js:130:11', message: 'Cannot read properties of undefined (reading \'length\')', constructor: 'Function<TypeError>', name: 'TypeError', toString: 'Function<toString>' }, getInfo: 'Function<getInfo>' }
|
src/commands/components/actions.test.ts > pull components actions > saveComponentsToFiles > should save components to separate files:
src/utils/error/filesystem-error.ts#L51
File System Error: An unknown error occurred
❯ Module.handleFileSystemError src/utils/error/filesystem-error.ts:51:11
❯ Module.saveComponentsToFiles src/commands/components/actions.ts:167:5
❯ src/commands/components/actions.test.ts:180:13
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { errorId: 'unknown_error', code: undefined, messageStack: [ 'Writing file', 'An unknown error occurred' ], error: { stack: 'TypeError: components is not iterable\n at Module.saveComponentsToFiles (/home/runner/work/storyblok-cli/storyblok-cli/src/commands/components/actions.ts:131:31)\n at /home/runner/work/storyblok-cli/storyblok-cli/src/commands/components/actions.test.ts:180:13\n at file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:146:14\n at file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:529:11\n at runWithTimeout (file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:61:7)\n at runTest (file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:982:17)\n at runSuite (file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:1131:15)\n at runSuite (file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:1131:15)\n at runSuite (file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:1131:15)\n at runFiles (file:///home/runner/work/storyblok-cli/storyblok-cli/node_modules/.pnpm/@vitest[email protected]/node_modules/@vitest/runner/dist/index.js:1188:5)', message: 'components is not iterable', constructor: 'Function<TypeError>', name: 'TypeError', toString: 'Function<toString>' }, getInfo: 'Function<getInfo>' }
|
src/commands/components/index.test.ts > pull > default mode > should prompt the user if the operation was sucessfull:
src/commands/components/index.test.ts#L102
AssertionError: expected "spy" to be called with arguments: [ '12345', 'valid-token', 'eu' ]
Received:
Number of calls: 0
❯ src/commands/components/index.test.ts:102:30
|
src/commands/components/index.test.ts > pull > --path option > should save the file at the provided path:
src/commands/components/index.test.ts#L155
AssertionError: expected "spy" to be called with arguments: [ '12345', 'valid-token', 'eu' ]
Received:
Number of calls: 0
❯ src/commands/components/index.test.ts:155:30
|
src/commands/components/index.test.ts > pull > --filename option > should save the file with the custom filename:
src/commands/components/index.test.ts#L184
AssertionError: expected "spy" to be called with arguments: [ '12345', 'valid-token', 'eu' ]
Received:
Number of calls: 0
❯ src/commands/components/index.test.ts:184:30
|
src/commands/components/index.test.ts > pull > --separate-files option > should save each component in a separate file:
src/commands/components/index.test.ts#L223
AssertionError: expected "spy" to be called with arguments: [ '12345', 'valid-token', 'eu' ]
Received:
Number of calls: 0
❯ src/commands/components/index.test.ts:223:30
|
src/commands/components/index.test.ts > pull > --separate-files option > should warn the user if the --filename is used along:
src/commands/components/index.test.ts#L250
AssertionError: expected "spy" to be called with arguments: [ '12345', 'valid-token', 'eu' ]
Received:
Number of calls: 0
❯ src/commands/components/index.test.ts:250:30
|
Test (20)
Process completed with exit code 1.
|