git ssb

0+

cel-desktop / ssb-pkg



Tree: cfc8d49135488f7554210234b3a503c2dbd6c6a5

Files: cfc8d49135488f7554210234b3a503c2dbd6c6a5 / test / test-50-may-exclude / test-x-index.js

1024 bytesRaw
1'use strict';
2
3// 1
4
5var error1;
6
7function func1 () {
8 require.resolve('not-exists-1', 'may-exclude');
9}
10
11try {
12 func1();
13} catch (e) {
14 error1 = e;
15}
16
17// 2
18
19var error2;
20
21function func2 () {
22 require.resolve('not-exists-2', 'may-exclude');
23}
24
25try {
26 func2();
27} catch (e) {
28 error2 = e;
29}
30
31// 3
32
33var error3;
34
35try {
36 require.resolve('not-exists-3');
37} catch (e) {
38 error3 = e;
39}
40
41// 4
42
43var error4;
44
45try {
46 if (process.env.HELLO !== 'WORLD') {
47 require.resolve('not-exists-4');
48 }
49} catch (e) {
50 error4 = e;
51}
52
53console.log([
54
55 error1.message.split('\n')[0],
56 error1.code,
57 JSON.stringify(Object.assign(error1, { requireStack: undefined })),
58 error2.message.split('\n')[0],
59 error2.code,
60 JSON.stringify(Object.assign(error2, { requireStack: undefined })),
61 error3.message.split('\n')[0],
62 error3.code,
63 JSON.stringify(Object.assign(error3, { requireStack: undefined })),
64 error4.message.split('\n')[0],
65 error4.code,
66 JSON.stringify(Object.assign(error4, { requireStack: undefined }))
67
68].join('\n'));
69

Built with git-ssb-web