@react-native-harness/runtime 1.0.0-alpha.9 → 1.0.0-canary.1761729829908
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.
- package/README.md +23 -4
- package/assets/moduleSystem.flow.js +23 -3
- package/dist/bundler/bundle.d.ts.map +1 -1
- package/dist/bundler/bundle.js +1 -2
- package/dist/bundler/evaluate.d.ts.map +1 -1
- package/dist/bundler/evaluate.js +7 -7
- package/dist/bundler/factory.d.ts +3 -0
- package/dist/bundler/factory.d.ts.map +1 -0
- package/dist/bundler/factory.js +36 -0
- package/dist/bundler/index.d.ts +2 -1
- package/dist/bundler/index.d.ts.map +1 -1
- package/dist/bundler/index.js +1 -1
- package/dist/bundler/types.d.ts +7 -0
- package/dist/bundler/types.d.ts.map +1 -0
- package/dist/bundler/types.js +1 -0
- package/dist/client/factory.d.ts.map +1 -1
- package/dist/client/factory.js +33 -12
- package/dist/client/getDeviceDescriptor.d.ts +1 -1
- package/dist/client/getDeviceDescriptor.d.ts.map +1 -1
- package/dist/client/getDeviceDescriptor.js +18 -6
- package/dist/client/setup-files.d.ts +12 -0
- package/dist/client/setup-files.d.ts.map +1 -0
- package/dist/client/setup-files.js +60 -0
- package/dist/collector/functions.d.ts +1 -1
- package/dist/collector/functions.d.ts.map +1 -1
- package/dist/collector/functions.js +10 -2
- package/dist/collector/types.d.ts +1 -1
- package/dist/collector/types.d.ts.map +1 -1
- package/dist/constants.d.ts +0 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +0 -1
- package/dist/entry-point.d.ts +2 -0
- package/dist/entry-point.d.ts.map +1 -0
- package/dist/entry-point.js +4 -0
- package/dist/expect/index.d.ts.map +1 -1
- package/dist/expect/index.js +2 -0
- package/dist/expect/setup.js +2 -0
- package/dist/filtering/index.d.ts +2 -0
- package/dist/filtering/index.d.ts.map +1 -0
- package/dist/filtering/index.js +1 -0
- package/dist/filtering/testNameFilter.d.ts +12 -0
- package/dist/filtering/testNameFilter.d.ts.map +1 -0
- package/dist/filtering/testNameFilter.js +56 -0
- package/dist/globals.d.ts +5 -2
- package/dist/globals.d.ts.map +1 -1
- package/dist/globals.js +7 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/initialize.js +7 -0
- package/dist/jest-mock.d.ts +2 -0
- package/dist/jest-mock.d.ts.map +1 -0
- package/dist/jest-mock.js +25 -0
- package/dist/mocker/index.d.ts +1 -1
- package/dist/mocker/index.d.ts.map +1 -1
- package/dist/mocker/index.js +1 -1
- package/dist/mocker/registry.d.ts +2 -2
- package/dist/mocker/registry.d.ts.map +1 -1
- package/dist/mocker/registry.js +10 -4
- package/dist/namespace.d.ts +18 -0
- package/dist/namespace.d.ts.map +1 -0
- package/dist/namespace.js +19 -0
- package/dist/render/ErrorBoundary.d.ts +17 -0
- package/dist/render/ErrorBoundary.d.ts.map +1 -0
- package/dist/render/ErrorBoundary.js +73 -0
- package/dist/render/TestComponentOverlay.d.ts +3 -0
- package/dist/render/TestComponentOverlay.d.ts.map +1 -0
- package/dist/render/TestComponentOverlay.js +36 -0
- package/dist/render/cleanup.d.ts +2 -0
- package/dist/render/cleanup.d.ts.map +1 -0
- package/dist/render/cleanup.js +6 -0
- package/dist/render/index.d.ts +6 -0
- package/dist/render/index.d.ts.map +1 -0
- package/dist/render/index.js +66 -0
- package/dist/render/setup.d.ts +2 -0
- package/dist/render/setup.d.ts.map +1 -0
- package/dist/render/setup.js +7 -0
- package/dist/render/types.d.ts +12 -0
- package/dist/render/types.d.ts.map +1 -0
- package/dist/render/types.js +1 -0
- package/dist/runner/factory.d.ts.map +1 -1
- package/dist/runner/factory.js +6 -1
- package/dist/runner/runSuite.d.ts.map +1 -1
- package/dist/runner/runSuite.js +37 -0
- package/dist/symbolicate.d.ts.map +1 -1
- package/dist/symbolicate.js +5 -4
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/ui/ReadyScreen.d.ts.map +1 -1
- package/dist/ui/ReadyScreen.js +3 -10
- package/dist/ui/WrongEnvironmentScreen.d.ts.map +1 -1
- package/dist/ui/WrongEnvironmentScreen.js +2 -10
- package/dist/ui/state.d.ts +13 -0
- package/dist/ui/state.d.ts.map +1 -1
- package/dist/ui/state.js +22 -0
- package/dist/utils/emitter.d.ts.map +1 -1
- package/dist/waitFor.d.ts +21 -0
- package/dist/waitFor.d.ts.map +1 -0
- package/dist/waitFor.js +137 -0
- package/eslint.config.mjs +1 -7
- package/out-tsc/vitest/src/__tests__/collector.test.d.ts +2 -0
- package/out-tsc/vitest/src/__tests__/collector.test.d.ts.map +1 -0
- package/out-tsc/vitest/src/__tests__/error-handling.test.d.ts +2 -0
- package/out-tsc/vitest/src/__tests__/error-handling.test.d.ts.map +1 -0
- package/out-tsc/vitest/src/__tests__/expect.test.d.ts +2 -0
- package/out-tsc/vitest/src/__tests__/expect.test.d.ts.map +1 -0
- package/out-tsc/vitest/src/__tests__/spy.test.d.ts +2 -0
- package/out-tsc/vitest/src/__tests__/spy.test.d.ts.map +1 -0
- package/out-tsc/vitest/src/bundler/bundle.d.ts +2 -0
- package/out-tsc/vitest/src/bundler/bundle.d.ts.map +1 -0
- package/out-tsc/vitest/src/bundler/errors.d.ts +15 -0
- package/out-tsc/vitest/src/bundler/errors.d.ts.map +1 -0
- package/out-tsc/vitest/src/bundler/evaluate.d.ts +2 -0
- package/out-tsc/vitest/src/bundler/evaluate.d.ts.map +1 -0
- package/out-tsc/vitest/src/bundler/factory.d.ts +3 -0
- package/out-tsc/vitest/src/bundler/factory.d.ts.map +1 -0
- package/out-tsc/vitest/src/bundler/index.d.ts +4 -0
- package/out-tsc/vitest/src/bundler/index.d.ts.map +1 -0
- package/out-tsc/vitest/src/bundler/types.d.ts +7 -0
- package/out-tsc/vitest/src/bundler/types.d.ts.map +1 -0
- package/out-tsc/vitest/src/client/factory.d.ts +2 -0
- package/out-tsc/vitest/src/client/factory.d.ts.map +1 -0
- package/out-tsc/vitest/src/client/getDeviceDescriptor.d.ts +8 -0
- package/out-tsc/vitest/src/client/getDeviceDescriptor.d.ts.map +1 -0
- package/out-tsc/vitest/src/client/getWSServer.d.ts +2 -0
- package/out-tsc/vitest/src/client/getWSServer.d.ts.map +1 -0
- package/out-tsc/vitest/src/client/index.d.ts +2 -0
- package/out-tsc/vitest/src/client/index.d.ts.map +1 -0
- package/out-tsc/vitest/src/collector/errors.d.ts +8 -0
- package/out-tsc/vitest/src/collector/errors.d.ts.map +1 -0
- package/out-tsc/vitest/src/collector/factory.d.ts +3 -0
- package/out-tsc/vitest/src/collector/factory.d.ts.map +1 -0
- package/out-tsc/vitest/src/collector/functions.d.ts +22 -0
- package/out-tsc/vitest/src/collector/functions.d.ts.map +1 -0
- package/out-tsc/vitest/src/collector/index.d.ts +5 -0
- package/out-tsc/vitest/src/collector/index.d.ts.map +1 -0
- package/out-tsc/vitest/src/collector/types.d.ts +10 -0
- package/out-tsc/vitest/src/collector/types.d.ts.map +1 -0
- package/out-tsc/vitest/src/collector/validation.d.ts +4 -0
- package/out-tsc/vitest/src/collector/validation.d.ts.map +1 -0
- package/out-tsc/vitest/src/constants.d.ts +3 -0
- package/out-tsc/vitest/src/constants.d.ts.map +1 -0
- package/out-tsc/vitest/src/entry-point.d.ts +2 -0
- package/out-tsc/vitest/src/entry-point.d.ts.map +1 -0
- package/out-tsc/vitest/src/errors.d.ts +6 -0
- package/out-tsc/vitest/src/errors.d.ts.map +1 -0
- package/out-tsc/vitest/src/expect/index.d.ts +9 -0
- package/out-tsc/vitest/src/expect/index.d.ts.map +1 -0
- package/out-tsc/vitest/src/expect/setup.d.ts +2 -0
- package/out-tsc/vitest/src/expect/setup.d.ts.map +1 -0
- package/out-tsc/vitest/src/filtering/index.d.ts +2 -0
- package/out-tsc/vitest/src/filtering/index.d.ts.map +1 -0
- package/out-tsc/vitest/src/filtering/testNameFilter.d.ts +12 -0
- package/out-tsc/vitest/src/filtering/testNameFilter.d.ts.map +1 -0
- package/out-tsc/vitest/src/globals.d.ts +8 -0
- package/out-tsc/vitest/src/globals.d.ts.map +1 -0
- package/out-tsc/vitest/src/index.d.ts +9 -0
- package/out-tsc/vitest/src/index.d.ts.map +1 -0
- package/out-tsc/vitest/src/initialize.d.ts +2 -0
- package/out-tsc/vitest/src/initialize.d.ts.map +1 -0
- package/out-tsc/vitest/src/mocker/index.d.ts +2 -0
- package/out-tsc/vitest/src/mocker/index.d.ts.map +1 -0
- package/out-tsc/vitest/src/mocker/registry.d.ts +7 -0
- package/out-tsc/vitest/src/mocker/registry.d.ts.map +1 -0
- package/out-tsc/vitest/src/mocker/types.d.ts +6 -0
- package/out-tsc/vitest/src/mocker/types.d.ts.map +1 -0
- package/out-tsc/vitest/src/namespace.d.ts +18 -0
- package/out-tsc/vitest/src/namespace.d.ts.map +1 -0
- package/out-tsc/vitest/src/runner/errors.d.ts +11 -0
- package/out-tsc/vitest/src/runner/errors.d.ts.map +1 -0
- package/out-tsc/vitest/src/runner/factory.d.ts +3 -0
- package/out-tsc/vitest/src/runner/factory.d.ts.map +1 -0
- package/out-tsc/vitest/src/runner/hooks.d.ts +4 -0
- package/out-tsc/vitest/src/runner/hooks.d.ts.map +1 -0
- package/out-tsc/vitest/src/runner/index.d.ts +4 -0
- package/out-tsc/vitest/src/runner/index.d.ts.map +1 -0
- package/out-tsc/vitest/src/runner/runSuite.d.ts +4 -0
- package/out-tsc/vitest/src/runner/runSuite.d.ts.map +1 -0
- package/out-tsc/vitest/src/runner/types.d.ts +13 -0
- package/out-tsc/vitest/src/runner/types.d.ts.map +1 -0
- package/out-tsc/vitest/src/spy/index.d.ts +2 -0
- package/out-tsc/vitest/src/spy/index.d.ts.map +1 -0
- package/out-tsc/vitest/src/symbolicate.d.ts +3 -0
- package/out-tsc/vitest/src/symbolicate.d.ts.map +1 -0
- package/out-tsc/vitest/src/ui/ReadyScreen.d.ts +2 -0
- package/out-tsc/vitest/src/ui/ReadyScreen.d.ts.map +1 -0
- package/out-tsc/vitest/src/ui/WrongEnvironmentScreen.d.ts +2 -0
- package/out-tsc/vitest/src/ui/WrongEnvironmentScreen.d.ts.map +1 -0
- package/out-tsc/vitest/src/ui/index.d.ts +2 -0
- package/out-tsc/vitest/src/ui/index.d.ts.map +1 -0
- package/out-tsc/vitest/src/ui/state.d.ts +7 -0
- package/out-tsc/vitest/src/ui/state.d.ts.map +1 -0
- package/out-tsc/vitest/src/utils/dev-server.d.ts +2 -0
- package/out-tsc/vitest/src/utils/dev-server.d.ts.map +1 -0
- package/out-tsc/vitest/src/utils/emitter.d.ts +16 -0
- package/out-tsc/vitest/src/utils/emitter.d.ts.map +1 -0
- package/out-tsc/vitest/src/waitFor.d.ts +21 -0
- package/out-tsc/vitest/src/waitFor.d.ts.map +1 -0
- package/out-tsc/vitest/tsconfig.spec.tsbuildinfo +1 -0
- package/out-tsc/vitest/vite.config.d.ts +3 -0
- package/out-tsc/vitest/vite.config.d.ts.map +1 -0
- package/package.json +10 -4
- package/src/__tests__/collector.test.ts +55 -55
- package/src/__tests__/error-handling.test.ts +34 -34
- package/src/__tests__/expect.test.ts +13 -5
- package/src/bundler/bundle.ts +1 -2
- package/src/bundler/evaluate.ts +9 -9
- package/src/bundler/factory.ts +43 -0
- package/src/bundler/index.ts +2 -1
- package/src/bundler/types.ts +7 -0
- package/src/client/factory.ts +51 -16
- package/src/client/getDeviceDescriptor.ts +29 -8
- package/src/client/setup-files.ts +81 -0
- package/src/collector/functions.ts +18 -2
- package/src/collector/types.ts +4 -1
- package/src/constants.ts +0 -1
- package/src/entry-point.ts +8 -0
- package/src/expect/index.ts +8 -2
- package/src/expect/setup.ts +3 -0
- package/src/filtering/index.ts +4 -0
- package/src/filtering/testNameFilter.ts +82 -0
- package/src/globals.ts +14 -2
- package/src/index.ts +3 -0
- package/src/initialize.ts +11 -1
- package/src/jest-mock.ts +32 -0
- package/src/mocker/index.ts +7 -1
- package/src/mocker/metro-require.d.ts +2 -0
- package/src/mocker/registry.ts +13 -5
- package/src/namespace.ts +41 -0
- package/src/react-native.d.ts +2 -10
- package/src/render/ErrorBoundary.tsx +108 -0
- package/src/render/TestComponentOverlay.tsx +47 -0
- package/src/render/cleanup.ts +7 -0
- package/src/render/index.ts +96 -0
- package/src/render/setup.ts +8 -0
- package/src/render/types.ts +11 -0
- package/src/runner/factory.ts +8 -1
- package/src/runner/runSuite.ts +43 -0
- package/src/symbolicate.ts +6 -4
- package/src/ui/ReadyScreen.tsx +2 -12
- package/src/ui/WrongEnvironmentScreen.tsx +1 -19
- package/src/ui/state.ts +39 -0
- package/src/utils/emitter.ts +1 -0
- package/src/waitFor.ts +199 -0
- package/tsconfig.spec.json +7 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/assets/logo.png +0 -0
- package/dist/utils/progressLogger.d.ts +0 -8
- package/dist/utils/progressLogger.d.ts.map +0 -1
- package/dist/utils/progressLogger.js +0 -73
- package/src/utils/progressLogger.ts +0 -91
- package/types/global.d.ts +0 -2
- package/types/index.d.ts +0 -1
|
@@ -6,8 +6,8 @@ const noop = () => {
|
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
describe('test collector - test case recognition', () => {
|
|
9
|
-
it('should collect basic test cases using it()', () => {
|
|
10
|
-
const collectedSuite = collectorFunctions.collectTests(() => {
|
|
9
|
+
it('should collect basic test cases using it()', async () => {
|
|
10
|
+
const collectedSuite = await collectorFunctions.collectTests(() => {
|
|
11
11
|
collectorFunctions.describe('Sample Suite', () => {
|
|
12
12
|
collectorFunctions.it('test 1', noop);
|
|
13
13
|
collectorFunctions.it('test 2', noop);
|
|
@@ -24,8 +24,8 @@ describe('test collector - test case recognition', () => {
|
|
|
24
24
|
expect(sampleSuite.tests[1].status).toBe('active');
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
it('should collect basic test cases using test()', () => {
|
|
28
|
-
const collectedSuite = collectorFunctions.collectTests(() => {
|
|
27
|
+
it('should collect basic test cases using test()', async () => {
|
|
28
|
+
const collectedSuite = await collectorFunctions.collectTests(() => {
|
|
29
29
|
collectorFunctions.describe('Sample Suite', () => {
|
|
30
30
|
collectorFunctions.test('test 1', noop);
|
|
31
31
|
collectorFunctions.test('test 2', noop);
|
|
@@ -39,8 +39,8 @@ describe('test collector - test case recognition', () => {
|
|
|
39
39
|
expect(sampleSuite.tests[1].name).toBe('test 2');
|
|
40
40
|
});
|
|
41
41
|
|
|
42
|
-
it('should collect async test functions', () => {
|
|
43
|
-
const collectedSuite = collectorFunctions.collectTests(() => {
|
|
42
|
+
it('should collect async test functions', async () => {
|
|
43
|
+
const collectedSuite = await collectorFunctions.collectTests(() => {
|
|
44
44
|
collectorFunctions.describe('Async Suite', () => {
|
|
45
45
|
collectorFunctions.it('async test', async () => {
|
|
46
46
|
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
@@ -53,8 +53,8 @@ describe('test collector - test case recognition', () => {
|
|
|
53
53
|
expect(typeof asyncSuite.tests[0].fn).toBe('function');
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
-
it('should collect tests at root level', () => {
|
|
57
|
-
const collectedSuite = collectorFunctions.collectTests(() => {
|
|
56
|
+
it('should collect tests at root level', async () => {
|
|
57
|
+
const collectedSuite = await collectorFunctions.collectTests(() => {
|
|
58
58
|
collectorFunctions.it('root test 1', noop);
|
|
59
59
|
collectorFunctions.test('root test 2', noop);
|
|
60
60
|
|
|
@@ -76,8 +76,8 @@ describe('test collector - test case recognition', () => {
|
|
|
76
76
|
expect(collectedSuite.testSuite.suites[0].tests[0].name).toBe('suite test');
|
|
77
77
|
});
|
|
78
78
|
|
|
79
|
-
it('should collect tests with modifiers at root level', () => {
|
|
80
|
-
const collectedSuite = collectorFunctions.collectTests(() => {
|
|
79
|
+
it('should collect tests with modifiers at root level', async () => {
|
|
80
|
+
const collectedSuite = await collectorFunctions.collectTests(() => {
|
|
81
81
|
collectorFunctions.it('regular root test', noop);
|
|
82
82
|
collectorFunctions.test.skip('skipped root test', noop);
|
|
83
83
|
collectorFunctions.it.todo('todo root test');
|
|
@@ -101,8 +101,8 @@ describe('test collector - test case recognition', () => {
|
|
|
101
101
|
});
|
|
102
102
|
|
|
103
103
|
describe('test collector - suite recognition', () => {
|
|
104
|
-
it('should collect nested describe blocks', () => {
|
|
105
|
-
const collectedSuite = collectorFunctions.collectTests(() => {
|
|
104
|
+
it('should collect nested describe blocks', async () => {
|
|
105
|
+
const collectedSuite = await collectorFunctions.collectTests(() => {
|
|
106
106
|
collectorFunctions.describe('Outer Suite', () => {
|
|
107
107
|
collectorFunctions.describe('Inner Suite 1', () => {
|
|
108
108
|
collectorFunctions.it('test 1', noop);
|
|
@@ -123,8 +123,8 @@ describe('test collector - suite recognition', () => {
|
|
|
123
123
|
expect(outerSuite.suites[1].tests[0].name).toBe('test 2');
|
|
124
124
|
});
|
|
125
125
|
|
|
126
|
-
it('should collect multiple top-level describe blocks', () => {
|
|
127
|
-
const collectedSuite = collectorFunctions.collectTests(() => {
|
|
126
|
+
it('should collect multiple top-level describe blocks', async () => {
|
|
127
|
+
const collectedSuite = await collectorFunctions.collectTests(() => {
|
|
128
128
|
collectorFunctions.describe('Suite 1', () => {
|
|
129
129
|
collectorFunctions.it('test 1', noop);
|
|
130
130
|
});
|
|
@@ -138,8 +138,8 @@ describe('test collector - suite recognition', () => {
|
|
|
138
138
|
expect(collectedSuite.testSuite.suites[1].name).toBe('Suite 2');
|
|
139
139
|
});
|
|
140
140
|
|
|
141
|
-
it('should collect deeply nested suites', () => {
|
|
142
|
-
const collectedSuite = collectorFunctions.collectTests(() => {
|
|
141
|
+
it('should collect deeply nested suites', async () => {
|
|
142
|
+
const collectedSuite = await collectorFunctions.collectTests(() => {
|
|
143
143
|
collectorFunctions.describe('Level 1', () => {
|
|
144
144
|
collectorFunctions.describe('Level 2', () => {
|
|
145
145
|
collectorFunctions.describe('Level 3', () => {
|
|
@@ -161,8 +161,8 @@ describe('test collector - suite recognition', () => {
|
|
|
161
161
|
});
|
|
162
162
|
|
|
163
163
|
describe('test collector - skip modifier recognition', () => {
|
|
164
|
-
it('should collect and mark skipped tests with test.skip()', () => {
|
|
165
|
-
const collectedSuite = collectorFunctions.collectTests(() => {
|
|
164
|
+
it('should collect and mark skipped tests with test.skip()', async () => {
|
|
165
|
+
const collectedSuite = await collectorFunctions.collectTests(() => {
|
|
166
166
|
collectorFunctions.describe('Skip Suite', () => {
|
|
167
167
|
collectorFunctions.it('active test', noop);
|
|
168
168
|
collectorFunctions.test.skip('skipped test', noop);
|
|
@@ -177,8 +177,8 @@ describe('test collector - skip modifier recognition', () => {
|
|
|
177
177
|
expect(skipSuite.tests[2].status).toBe('skipped');
|
|
178
178
|
});
|
|
179
179
|
|
|
180
|
-
it('should collect and mark skipped suites with describe.skip()', () => {
|
|
181
|
-
const collectedSuite = collectorFunctions.collectTests(() => {
|
|
180
|
+
it('should collect and mark skipped suites with describe.skip()', async () => {
|
|
181
|
+
const collectedSuite = await collectorFunctions.collectTests(() => {
|
|
182
182
|
collectorFunctions.describe('Active Suite', () => {
|
|
183
183
|
collectorFunctions.it('active test', noop);
|
|
184
184
|
});
|
|
@@ -192,8 +192,8 @@ describe('test collector - skip modifier recognition', () => {
|
|
|
192
192
|
expect(collectedSuite.testSuite.suites[1].status).toBe('skipped');
|
|
193
193
|
});
|
|
194
194
|
|
|
195
|
-
it('should collect nested skipped suites', () => {
|
|
196
|
-
const collectedSuite = collectorFunctions.collectTests(() => {
|
|
195
|
+
it('should collect nested skipped suites', async () => {
|
|
196
|
+
const collectedSuite = await collectorFunctions.collectTests(() => {
|
|
197
197
|
collectorFunctions.describe.skip('Outer Skipped', () => {
|
|
198
198
|
collectorFunctions.describe('Inner Suite', () => {
|
|
199
199
|
collectorFunctions.it('test', noop);
|
|
@@ -208,8 +208,8 @@ describe('test collector - skip modifier recognition', () => {
|
|
|
208
208
|
});
|
|
209
209
|
|
|
210
210
|
describe('test collector - only modifier recognition', () => {
|
|
211
|
-
it('should collect and mark only tests and skip others with test.only()', () => {
|
|
212
|
-
const collectedSuite = collectorFunctions.collectTests(() => {
|
|
211
|
+
it('should collect and mark only tests and skip others with test.only()', async () => {
|
|
212
|
+
const collectedSuite = await collectorFunctions.collectTests(() => {
|
|
213
213
|
collectorFunctions.describe('Only Suite', () => {
|
|
214
214
|
collectorFunctions.it('regular test 1', noop);
|
|
215
215
|
collectorFunctions.test.only('focused test', noop);
|
|
@@ -225,8 +225,8 @@ describe('test collector - only modifier recognition', () => {
|
|
|
225
225
|
expect(onlySuite._hasFocused).toBe(true);
|
|
226
226
|
});
|
|
227
227
|
|
|
228
|
-
it('should collect multiple test.only() calls', () => {
|
|
229
|
-
const collectedSuite = collectorFunctions.collectTests(() => {
|
|
228
|
+
it('should collect multiple test.only() calls', async () => {
|
|
229
|
+
const collectedSuite = await collectorFunctions.collectTests(() => {
|
|
230
230
|
collectorFunctions.describe('Multiple Only Suite', () => {
|
|
231
231
|
collectorFunctions.it('regular test', noop);
|
|
232
232
|
collectorFunctions.test.only('focused test 1', noop);
|
|
@@ -240,8 +240,8 @@ describe('test collector - only modifier recognition', () => {
|
|
|
240
240
|
expect(multipleSuite.tests[2].status).toBe('active'); // Second only also active
|
|
241
241
|
});
|
|
242
242
|
|
|
243
|
-
it('should collect and mark only suites and skip others with describe.only()', () => {
|
|
244
|
-
const collectedSuite = collectorFunctions.collectTests(() => {
|
|
243
|
+
it('should collect and mark only suites and skip others with describe.only()', async () => {
|
|
244
|
+
const collectedSuite = await collectorFunctions.collectTests(() => {
|
|
245
245
|
collectorFunctions.describe('Regular Suite 1', () => {
|
|
246
246
|
collectorFunctions.it('test 1', noop);
|
|
247
247
|
});
|
|
@@ -260,8 +260,8 @@ describe('test collector - only modifier recognition', () => {
|
|
|
260
260
|
expect(collectedSuite.testSuite.suites[1]._hasFocused).toBe(true);
|
|
261
261
|
});
|
|
262
262
|
|
|
263
|
-
it('should collect nested describe.only()', () => {
|
|
264
|
-
const collectedSuite = collectorFunctions.collectTests(() => {
|
|
263
|
+
it('should collect nested describe.only()', async () => {
|
|
264
|
+
const collectedSuite = await collectorFunctions.collectTests(() => {
|
|
265
265
|
collectorFunctions.describe('Outer Suite', () => {
|
|
266
266
|
collectorFunctions.describe('Regular Inner', () => {
|
|
267
267
|
collectorFunctions.it('test 1', noop);
|
|
@@ -281,8 +281,8 @@ describe('test collector - only modifier recognition', () => {
|
|
|
281
281
|
});
|
|
282
282
|
|
|
283
283
|
describe('test collector - todo test recognition', () => {
|
|
284
|
-
it('should collect and mark todo tests with test.todo()', () => {
|
|
285
|
-
const collectedSuite = collectorFunctions.collectTests(() => {
|
|
284
|
+
it('should collect and mark todo tests with test.todo()', async () => {
|
|
285
|
+
const collectedSuite = await collectorFunctions.collectTests(() => {
|
|
286
286
|
collectorFunctions.describe('Todo Suite', () => {
|
|
287
287
|
collectorFunctions.it('regular test', noop);
|
|
288
288
|
collectorFunctions.test.todo('todo test');
|
|
@@ -297,8 +297,8 @@ describe('test collector - todo test recognition', () => {
|
|
|
297
297
|
expect(todoSuite.tests[2].status).toBe('todo');
|
|
298
298
|
});
|
|
299
299
|
|
|
300
|
-
it('should collect todo tests without function bodies', () => {
|
|
301
|
-
const collectedSuite = collectorFunctions.collectTests(() => {
|
|
300
|
+
it('should collect todo tests without function bodies', async () => {
|
|
301
|
+
const collectedSuite = await collectorFunctions.collectTests(() => {
|
|
302
302
|
collectorFunctions.describe('Todo Suite', () => {
|
|
303
303
|
collectorFunctions.test.todo('implement this feature');
|
|
304
304
|
});
|
|
@@ -312,8 +312,8 @@ describe('test collector - todo test recognition', () => {
|
|
|
312
312
|
});
|
|
313
313
|
|
|
314
314
|
describe('test collector - hook recognition', () => {
|
|
315
|
-
it('should collect beforeAll hooks', () => {
|
|
316
|
-
const collectedSuite = collectorFunctions.collectTests(() => {
|
|
315
|
+
it('should collect beforeAll hooks', async () => {
|
|
316
|
+
const collectedSuite = await collectorFunctions.collectTests(() => {
|
|
317
317
|
collectorFunctions.describe('Hook Suite', () => {
|
|
318
318
|
collectorFunctions.beforeAll(() => {
|
|
319
319
|
// setup
|
|
@@ -331,8 +331,8 @@ describe('test collector - hook recognition', () => {
|
|
|
331
331
|
expect(typeof hookSuite.beforeAll[1]).toBe('function');
|
|
332
332
|
});
|
|
333
333
|
|
|
334
|
-
it('should collect afterAll hooks', () => {
|
|
335
|
-
const collectedSuite = collectorFunctions.collectTests(() => {
|
|
334
|
+
it('should collect afterAll hooks', async () => {
|
|
335
|
+
const collectedSuite = await collectorFunctions.collectTests(() => {
|
|
336
336
|
collectorFunctions.describe('Hook Suite', () => {
|
|
337
337
|
collectorFunctions.afterAll(() => {
|
|
338
338
|
// cleanup
|
|
@@ -346,8 +346,8 @@ describe('test collector - hook recognition', () => {
|
|
|
346
346
|
expect(typeof hookSuite.afterAll[0]).toBe('function');
|
|
347
347
|
});
|
|
348
348
|
|
|
349
|
-
it('should collect beforeEach hooks', () => {
|
|
350
|
-
const collectedSuite = collectorFunctions.collectTests(() => {
|
|
349
|
+
it('should collect beforeEach hooks', async () => {
|
|
350
|
+
const collectedSuite = await collectorFunctions.collectTests(() => {
|
|
351
351
|
collectorFunctions.describe('Hook Suite', () => {
|
|
352
352
|
collectorFunctions.beforeEach(() => {
|
|
353
353
|
// setup each
|
|
@@ -365,8 +365,8 @@ describe('test collector - hook recognition', () => {
|
|
|
365
365
|
expect(typeof hookSuite.beforeEach[1]).toBe('function');
|
|
366
366
|
});
|
|
367
367
|
|
|
368
|
-
it('should collect afterEach hooks', () => {
|
|
369
|
-
const collectedSuite = collectorFunctions.collectTests(() => {
|
|
368
|
+
it('should collect afterEach hooks', async () => {
|
|
369
|
+
const collectedSuite = await collectorFunctions.collectTests(() => {
|
|
370
370
|
collectorFunctions.describe('Hook Suite', () => {
|
|
371
371
|
collectorFunctions.afterEach(() => {
|
|
372
372
|
// cleanup each
|
|
@@ -380,8 +380,8 @@ describe('test collector - hook recognition', () => {
|
|
|
380
380
|
expect(typeof hookSuite.afterEach[0]).toBe('function');
|
|
381
381
|
});
|
|
382
382
|
|
|
383
|
-
it('should collect all types of hooks together', () => {
|
|
384
|
-
const collectedSuite = collectorFunctions.collectTests(() => {
|
|
383
|
+
it('should collect all types of hooks together', async () => {
|
|
384
|
+
const collectedSuite = await collectorFunctions.collectTests(() => {
|
|
385
385
|
collectorFunctions.describe('All Hooks Suite', () => {
|
|
386
386
|
collectorFunctions.beforeAll(noop);
|
|
387
387
|
collectorFunctions.afterAll(noop);
|
|
@@ -398,8 +398,8 @@ describe('test collector - hook recognition', () => {
|
|
|
398
398
|
expect(allHooksSuite.afterEach).toHaveLength(1);
|
|
399
399
|
});
|
|
400
400
|
|
|
401
|
-
it('should collect hooks at root level', () => {
|
|
402
|
-
const collectedSuite = collectorFunctions.collectTests(() => {
|
|
401
|
+
it('should collect hooks at root level', async () => {
|
|
402
|
+
const collectedSuite = await collectorFunctions.collectTests(() => {
|
|
403
403
|
collectorFunctions.beforeAll(() => {
|
|
404
404
|
// root level setup
|
|
405
405
|
});
|
|
@@ -429,8 +429,8 @@ describe('test collector - hook recognition', () => {
|
|
|
429
429
|
expect(typeof collectedSuite.testSuite.afterEach[0]).toBe('function');
|
|
430
430
|
});
|
|
431
431
|
|
|
432
|
-
it('should collect hooks at both root and suite levels', () => {
|
|
433
|
-
const collectedSuite = collectorFunctions.collectTests(() => {
|
|
432
|
+
it('should collect hooks at both root and suite levels', async () => {
|
|
433
|
+
const collectedSuite = await collectorFunctions.collectTests(() => {
|
|
434
434
|
// Root level hooks
|
|
435
435
|
collectorFunctions.beforeAll(() => {
|
|
436
436
|
// global setup
|
|
@@ -463,8 +463,8 @@ describe('test collector - hook recognition', () => {
|
|
|
463
463
|
});
|
|
464
464
|
|
|
465
465
|
describe('test collector - complex scenarios', () => {
|
|
466
|
-
it('should collect mix of tests, suites, hooks, and modifiers', () => {
|
|
467
|
-
const collectedSuite = collectorFunctions.collectTests(() => {
|
|
466
|
+
it('should collect mix of tests, suites, hooks, and modifiers', async () => {
|
|
467
|
+
const collectedSuite = await collectorFunctions.collectTests(() => {
|
|
468
468
|
collectorFunctions.describe('Complex Suite', () => {
|
|
469
469
|
collectorFunctions.beforeAll(noop);
|
|
470
470
|
collectorFunctions.beforeEach(noop);
|
|
@@ -515,14 +515,14 @@ describe('test collector - complex scenarios', () => {
|
|
|
515
515
|
expect(innerSuite.tests[2].status).toBe('skipped'); // Due to .only
|
|
516
516
|
});
|
|
517
517
|
|
|
518
|
-
it('should clear collector state between collectTests calls', () => {
|
|
519
|
-
const collectedSuite1 = collectorFunctions.collectTests(() => {
|
|
518
|
+
it('should clear collector state between collectTests calls', async () => {
|
|
519
|
+
const collectedSuite1 = await collectorFunctions.collectTests(() => {
|
|
520
520
|
collectorFunctions.describe('Suite 1', () => {
|
|
521
521
|
collectorFunctions.it('test 1', noop);
|
|
522
522
|
});
|
|
523
523
|
});
|
|
524
524
|
|
|
525
|
-
const collectedSuite2 = collectorFunctions.collectTests(() => {
|
|
525
|
+
const collectedSuite2 = await collectorFunctions.collectTests(() => {
|
|
526
526
|
collectorFunctions.describe('Suite 2', () => {
|
|
527
527
|
collectorFunctions.it('test 2', noop);
|
|
528
528
|
});
|
|
@@ -534,8 +534,8 @@ describe('test collector - complex scenarios', () => {
|
|
|
534
534
|
expect(collectedSuite2.testSuite.suites[0].name).toBe('Suite 2');
|
|
535
535
|
});
|
|
536
536
|
|
|
537
|
-
it('should collect empty describe blocks', () => {
|
|
538
|
-
const collectedSuite = collectorFunctions.collectTests(() => {
|
|
537
|
+
it('should collect empty describe blocks', async () => {
|
|
538
|
+
const collectedSuite = await collectorFunctions.collectTests(() => {
|
|
539
539
|
collectorFunctions.describe('Empty Suite', () => {
|
|
540
540
|
// No tests or hooks
|
|
541
541
|
});
|
|
@@ -7,44 +7,44 @@ const noop = () => {
|
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
describe('error handling', () => {
|
|
10
|
-
it('should throw TestError with proper code for invalid test names', () => {
|
|
11
|
-
expect(() =>
|
|
10
|
+
it('should throw TestError with proper code for invalid test names', async () => {
|
|
11
|
+
await expect(() =>
|
|
12
12
|
harnessRuntime.collectTests(() => {
|
|
13
13
|
harnessRuntime.describe('Test Suite', () => {
|
|
14
14
|
harnessRuntime.test('', noop);
|
|
15
15
|
});
|
|
16
|
-
})
|
|
17
|
-
|
|
16
|
+
})
|
|
17
|
+
).rejects.toThrow(TestError);
|
|
18
18
|
|
|
19
|
-
expect(() =>
|
|
19
|
+
await expect(() =>
|
|
20
20
|
harnessRuntime.collectTests(() => {
|
|
21
21
|
harnessRuntime.describe('Test Suite', () => {
|
|
22
22
|
harnessRuntime.test(null as unknown as string, noop);
|
|
23
23
|
});
|
|
24
|
-
})
|
|
25
|
-
|
|
24
|
+
})
|
|
25
|
+
).rejects.toThrow(TestError);
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
-
it('should throw TestError with proper code for invalid functions', () => {
|
|
29
|
-
expect(() =>
|
|
28
|
+
it('should throw TestError with proper code for invalid functions', async () => {
|
|
29
|
+
await expect(() =>
|
|
30
30
|
harnessRuntime.collectTests(() => {
|
|
31
31
|
harnessRuntime.describe('Test Suite', () => {
|
|
32
32
|
// @ts-expect-error - Testing invalid input
|
|
33
33
|
harnessRuntime.test('test name', null);
|
|
34
34
|
});
|
|
35
|
-
})
|
|
36
|
-
|
|
35
|
+
})
|
|
36
|
+
).rejects.toThrow(TestError);
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
it('should throw TestError for duplicate test names', () => {
|
|
40
|
-
expect(() =>
|
|
39
|
+
it('should throw TestError for duplicate test names', async () => {
|
|
40
|
+
await expect(() =>
|
|
41
41
|
harnessRuntime.collectTests(() => {
|
|
42
42
|
harnessRuntime.describe('Test Suite', () => {
|
|
43
43
|
harnessRuntime.test('duplicate name', noop);
|
|
44
44
|
harnessRuntime.test('duplicate name', noop);
|
|
45
45
|
});
|
|
46
|
-
})
|
|
47
|
-
|
|
46
|
+
})
|
|
47
|
+
).rejects.toThrow(TestError);
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
it('should throw TestError when calling test outside describe', () => {
|
|
@@ -71,9 +71,9 @@ describe('error handling', () => {
|
|
|
71
71
|
}).toThrow(TestError);
|
|
72
72
|
});
|
|
73
73
|
|
|
74
|
-
it('should provide proper error context', () => {
|
|
74
|
+
it('should provide proper error context', async () => {
|
|
75
75
|
try {
|
|
76
|
-
harnessRuntime.collectTests(() => {
|
|
76
|
+
await harnessRuntime.collectTests(() => {
|
|
77
77
|
harnessRuntime.describe('Test Suite', () => {
|
|
78
78
|
harnessRuntime.test('test1', noop);
|
|
79
79
|
harnessRuntime.test('test1', noop);
|
|
@@ -89,44 +89,44 @@ describe('error handling', () => {
|
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
91
|
|
|
92
|
-
it('should validate describe function inputs', () => {
|
|
93
|
-
expect(() =>
|
|
92
|
+
it('should validate describe function inputs', async () => {
|
|
93
|
+
await expect(() =>
|
|
94
94
|
harnessRuntime.collectTests(() => {
|
|
95
95
|
harnessRuntime.describe('', noop);
|
|
96
|
-
})
|
|
97
|
-
|
|
96
|
+
})
|
|
97
|
+
).rejects.toThrow(TestError);
|
|
98
98
|
|
|
99
|
-
expect(() =>
|
|
99
|
+
await expect(() =>
|
|
100
100
|
harnessRuntime.collectTests(() => {
|
|
101
101
|
// @ts-expect-error - Testing invalid input
|
|
102
102
|
harnessRuntime.describe('Test Suite', null);
|
|
103
|
-
})
|
|
104
|
-
|
|
103
|
+
})
|
|
104
|
+
).rejects.toThrow(TestError);
|
|
105
105
|
});
|
|
106
106
|
|
|
107
|
-
it('should validate test modifiers', () => {
|
|
108
|
-
expect(() =>
|
|
107
|
+
it('should validate test modifiers', async () => {
|
|
108
|
+
await expect(() =>
|
|
109
109
|
harnessRuntime.collectTests(() => {
|
|
110
110
|
harnessRuntime.describe('Test Suite', () => {
|
|
111
111
|
harnessRuntime.test.skip('', noop);
|
|
112
112
|
});
|
|
113
|
-
})
|
|
114
|
-
|
|
113
|
+
})
|
|
114
|
+
).rejects.toThrow(TestError);
|
|
115
115
|
|
|
116
|
-
expect(() =>
|
|
116
|
+
await expect(() =>
|
|
117
117
|
harnessRuntime.collectTests(() => {
|
|
118
118
|
harnessRuntime.describe('Test Suite', () => {
|
|
119
119
|
harnessRuntime.test.only('', noop);
|
|
120
120
|
});
|
|
121
|
-
})
|
|
122
|
-
|
|
121
|
+
})
|
|
122
|
+
).rejects.toThrow(TestError);
|
|
123
123
|
|
|
124
|
-
expect(() =>
|
|
124
|
+
await expect(() =>
|
|
125
125
|
harnessRuntime.collectTests(() => {
|
|
126
126
|
harnessRuntime.describe('Test Suite', () => {
|
|
127
127
|
harnessRuntime.test.todo('');
|
|
128
128
|
});
|
|
129
|
-
})
|
|
130
|
-
|
|
129
|
+
})
|
|
130
|
+
).rejects.toThrow(TestError);
|
|
131
131
|
});
|
|
132
132
|
});
|
|
@@ -72,7 +72,9 @@ describe('expect - Truthiness', () => {
|
|
|
72
72
|
expect('hello').toBeTruthy();
|
|
73
73
|
expect({}).toBeTruthy();
|
|
74
74
|
expect([]).toBeTruthy();
|
|
75
|
-
expect(function () {
|
|
75
|
+
expect(function () {
|
|
76
|
+
// noop
|
|
77
|
+
}).toBeTruthy();
|
|
76
78
|
});
|
|
77
79
|
|
|
78
80
|
test('should fail for falsy values', () => {
|
|
@@ -330,7 +332,9 @@ describe('expect - Type Checking', () => {
|
|
|
330
332
|
expect(true).toBeTypeOf('boolean');
|
|
331
333
|
expect(undefined).toBeTypeOf('undefined');
|
|
332
334
|
expect(Symbol('test')).toBeTypeOf('symbol');
|
|
333
|
-
expect(() => {
|
|
335
|
+
expect(() => {
|
|
336
|
+
// noop
|
|
337
|
+
}).toBeTypeOf('function');
|
|
334
338
|
expect({}).toBeTypeOf('object');
|
|
335
339
|
});
|
|
336
340
|
|
|
@@ -406,7 +410,11 @@ describe('expect - Exceptions', () => {
|
|
|
406
410
|
});
|
|
407
411
|
|
|
408
412
|
test('should fail for functions that do not throw', () => {
|
|
409
|
-
expect(() =>
|
|
413
|
+
expect(() =>
|
|
414
|
+
expect(() => {
|
|
415
|
+
// noop
|
|
416
|
+
}).toThrow()
|
|
417
|
+
).toThrow();
|
|
410
418
|
});
|
|
411
419
|
|
|
412
420
|
test('should fail for wrong error message', () => {
|
|
@@ -558,10 +566,10 @@ describe('expect - Custom Messages', () => {
|
|
|
558
566
|
|
|
559
567
|
describe('expect - Edge Cases', () => {
|
|
560
568
|
test('should handle circular references', () => {
|
|
561
|
-
const circular:
|
|
569
|
+
const circular: Record<string, unknown> = { a: 1 };
|
|
562
570
|
circular.self = circular;
|
|
563
571
|
|
|
564
|
-
const circular2:
|
|
572
|
+
const circular2: Record<string, unknown> = { a: 1 };
|
|
565
573
|
circular2.self = circular2;
|
|
566
574
|
|
|
567
575
|
expect(circular).toEqual(circular2);
|
package/src/bundler/bundle.ts
CHANGED
|
@@ -8,10 +8,9 @@ const getModuleUrl = (fileName: string): string => {
|
|
|
8
8
|
const urlSearchParams = new URLSearchParams({
|
|
9
9
|
modulesOnly: 'true',
|
|
10
10
|
platform: Platform.OS,
|
|
11
|
-
'resolver.isHarness': 'true',
|
|
12
11
|
});
|
|
13
12
|
|
|
14
|
-
return `${devServerUrl}
|
|
13
|
+
return `${devServerUrl}${bundleName}?${urlSearchParams.toString()}`;
|
|
15
14
|
};
|
|
16
15
|
|
|
17
16
|
export const fetchModule = async (fileName: string): Promise<string> => {
|
package/src/bundler/evaluate.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { MalformedModuleError } from './errors.js';
|
|
2
|
-
import { EnvironmentError } from '../errors.js';
|
|
3
2
|
|
|
4
3
|
export const evaluateModule = (moduleJs: string, modulePath: string): void => {
|
|
5
|
-
const
|
|
4
|
+
const __rMatches = Array.from(moduleJs.matchAll(/__r\((\d+)\)/g));
|
|
6
5
|
|
|
7
|
-
if (
|
|
6
|
+
if (__rMatches.length === 0) {
|
|
8
7
|
throw new MalformedModuleError(modulePath, 'No __r function found');
|
|
9
8
|
}
|
|
10
9
|
|
|
10
|
+
// Get the last match as there may be many require calls
|
|
11
|
+
const __rMatch = __rMatches[__rMatches.length - 1];
|
|
11
12
|
const __rParam = __rMatch[1];
|
|
12
13
|
|
|
13
14
|
if (!__rParam) {
|
|
14
15
|
throw new MalformedModuleError(modulePath, 'No __r parameter found');
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
eval(moduleJs);
|
|
18
|
+
const moduleId = Number(__rParam);
|
|
19
19
|
|
|
20
|
-
if
|
|
21
|
-
|
|
22
|
-
}
|
|
20
|
+
// This is important as if module was already initialized, it would not be re-initialized
|
|
21
|
+
global.__clearModule(moduleId);
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
// eslint-disable-next-line no-eval
|
|
24
|
+
eval(moduleJs);
|
|
25
25
|
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { BundlerEvents } from '@react-native-harness/bridge';
|
|
2
|
+
import { getEmitter } from '../utils/emitter.js';
|
|
3
|
+
import { Bundler } from './types.js';
|
|
4
|
+
import { fetchModule } from './bundle.js';
|
|
5
|
+
import { BundlingFailedError } from './errors.js';
|
|
6
|
+
|
|
7
|
+
export const getBundler = (): Bundler => {
|
|
8
|
+
const events = getEmitter<BundlerEvents>();
|
|
9
|
+
|
|
10
|
+
return {
|
|
11
|
+
events,
|
|
12
|
+
getModule: async (filePath) => {
|
|
13
|
+
const bundlingStartTime = Date.now();
|
|
14
|
+
events.emit({
|
|
15
|
+
type: 'module-bundling-started',
|
|
16
|
+
file: filePath,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
const moduleJs = await fetchModule(filePath);
|
|
21
|
+
events.emit({
|
|
22
|
+
type: 'module-bundling-finished',
|
|
23
|
+
file: filePath,
|
|
24
|
+
duration: Date.now() - bundlingStartTime,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
return moduleJs;
|
|
28
|
+
} catch (error) {
|
|
29
|
+
events.emit({
|
|
30
|
+
type: 'module-bundling-failed',
|
|
31
|
+
file: filePath,
|
|
32
|
+
duration: Date.now() - bundlingStartTime,
|
|
33
|
+
error:
|
|
34
|
+
error instanceof BundlingFailedError
|
|
35
|
+
? error.reason
|
|
36
|
+
: 'Unknown error',
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
throw error;
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
};
|
package/src/bundler/index.ts
CHANGED