Files: 4c58f1c6c3ddb86a97f27f0c84681d201ef1f75f / test / test-50-may-exclude / test-x-index.js
1024 bytesRaw
1 | ; |
2 | |
3 | // 1 |
4 | |
5 | var error1; |
6 | |
7 | function func1 () { |
8 | require.resolve('not-exists-1', 'may-exclude'); |
9 | } |
10 | |
11 | try { |
12 | func1(); |
13 | } catch (e) { |
14 | error1 = e; |
15 | } |
16 | |
17 | // 2 |
18 | |
19 | var error2; |
20 | |
21 | function func2 () { |
22 | require.resolve('not-exists-2', 'may-exclude'); |
23 | } |
24 | |
25 | try { |
26 | func2(); |
27 | } catch (e) { |
28 | error2 = e; |
29 | } |
30 | |
31 | // 3 |
32 | |
33 | var error3; |
34 | |
35 | try { |
36 | require.resolve('not-exists-3'); |
37 | } catch (e) { |
38 | error3 = e; |
39 | } |
40 | |
41 | // 4 |
42 | |
43 | var error4; |
44 | |
45 | try { |
46 | if (process.env.HELLO !== 'WORLD') { |
47 | require.resolve('not-exists-4'); |
48 | } |
49 | } catch (e) { |
50 | error4 = e; |
51 | } |
52 | |
53 | console.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