/
fatalError.stories.js
77 lines (71 loc) · 2.61 KB
/
fatalError.stories.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import fatalError from './fatalError';
export default {
title: 'CLI/Messages/Errors',
};
const context = {
sessionId: '452a4bfa-5f0f-45a9-bf02-cd0ba550472a',
git: { version: '2.24.1 (Apple Git-126)' },
pkg: {
name: 'chromatic',
version: '4.0.3',
description: 'Visual Testing for Storybook',
homepage: 'https://www.chromatic.com',
docs: 'https://www.chromatic.com/docs/',
bugs: {
url: 'https://github.com/chromaui/chromatic-cli',
email: 'support@chromatic.com',
},
},
packageJson: {
scripts: {
'build:storybook': 'build-storybook -o dist/storybook',
},
},
flags: {
projectToken: 'asdf123',
buildScriptName: 'build:storybook',
},
options: {
buildScriptName: 'build:storybook',
},
spawnParams: {
client: 'npm',
clientVersion: '7.11.2',
platform: 'darwin',
command: 'npm',
clientArgs: ['run', '--silent'],
scriptArgs: ['build:storybook', '--', '--output-dir', '/tmp/path/to/output'],
spawnOptions: {
preferLocal: true,
localDir: '/path/to/node_modules/.bin',
},
},
exitCode: 255,
build: {
id: '5ec5069ae0d35e0022b6a9cc',
number: 1400,
webUrl: 'https://www.chromatic.com/build?appId=5d67dc0374b2e300209c41e7&number=1400',
},
isolatorUrl: 'https://pfkaemtlit.tunnel.chromaticqa.com/iframe.html',
cachedUrl: 'https://5d67dc0374b2e300209c41e7-pfkaemtlit.chromatic.com/iframe.html',
};
const stack = `Error: Oh no!
at FatalError (http://localhost:9009/main.6eda3407d6f38d88bd8d.bundle.js:2068:24)
at http://localhost:9009/vendors~main.6eda3407d6f38d88bd8d.bundle.js:251:21
at http://localhost:9009/vendors~main.6eda3407d6f38d88bd8d.bundle.js:1554:16
at http://localhost:9009/main.6eda3407d6f38d88bd8d.bundle.js:110:66
at http://localhost:9009/vendors~main.6eda3407d6f38d88bd8d.bundle.js:251:21
at http://localhost:9009/vendors~main.6eda3407d6f38d88bd8d.bundle.js:1553:14
at http://localhost:9009/vendors~main.6eda3407d6f38d88bd8d.bundle.js:1554:16
at withSubscriptionTracking (http://localhost:9009/vendors~main.6eda3407d6f38d88bd8d.bundle.js:1582:16)
at http://localhost:9009/vendors~main.6eda3407d6f38d88bd8d.bundle.js:251:21
at http://localhost:9009/vendors~main.6eda3407d6f38d88bd8d.bundle.js:1553:14`;
const timestamp = '2020-05-12T15:06:30.553Z';
export const FatalError = () => {
const error = { name: 'SyntaxError', message: "That's not right!", stack };
return fatalError(context, error, timestamp);
};
export const FatalErrorSimple = () => {
const error = { name: 'SyntaxError', message: "That's not right!" };
return fatalError(context, error, timestamp);
};