Skip to content

Commit 5f3ea86

Browse files
committed
Small test inconsequential update
1 parent 0eff8a0 commit 5f3ea86

File tree

2 files changed

+30
-35
lines changed

2 files changed

+30
-35
lines changed

packages/tests/jest.config.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@ module.exports = {
77
clearMocks: true,
88
globalSetup: '<rootDir>/src/_jest/globalSetup.ts',
99
preset: 'ts-jest/presets/js-with-ts',
10-
reporters: [['default', { summaryThreshold: 2 }]],
1110
// Without it, vite import is silently crashing the process with code SIGHUP 129
1211
resetModules: true,
1312
roots: ['./src/'],
1413
setupFilesAfterEnv: ['<rootDir>/src/_jest/setupAfterEnv.ts'],
1514
testEnvironment: 'node',
1615
testMatch: ['**/*.test.*'],
17-
// We're building a lot of projects in parallel, so we need to increase the timeout.
18-
testTimeout: 20000,
1916
};

packages/tests/src/plugins/telemetry/index.test.ts

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -114,41 +114,39 @@ describe('Telemetry Universal Plugin', () => {
114114

115115
// We don't want to crash if there are no bundlers to test here.
116116
// Which can happen when using --bundlers.
117-
if (expectations.length > 0) {
118-
let cleanup: CleanupFn;
119-
120-
beforeAll(async () => {
121-
const pluginConfig: Options = {
122-
telemetry: {
123-
enableTracing: true,
124-
endPoint: FAKE_URL,
125-
filters: [],
126-
},
127-
logLevel: 'warn',
128-
customPlugins: (options: Options, context: GlobalContext) =>
129-
debugFilesPlugins(context),
130-
};
131-
// This one is called at initialization, with the initial context.
132-
addMetricsMocked.mockImplementation(getAddMetricsImplem(metrics));
133-
cleanup = await runBundlers(
134-
pluginConfig,
135-
getComplexBuildOverrides(),
136-
activeBundlers,
137-
);
138-
});
117+
if (!expectations.length) {
118+
return;
119+
}
139120

140-
afterAll(async () => {
141-
await cleanup();
142-
});
121+
let cleanup: CleanupFn;
143122

144-
test.each(expectations)(
145-
'$name - $version | Should get the related metrics',
146-
({ name, expectedMetrics }) => {
147-
const metricNames = metrics[name].map((metric) => metric.metric).sort();
148-
expect(metricNames).toEqual(expect.arrayContaining(expectedMetrics));
123+
beforeAll(async () => {
124+
const pluginConfig: Options = {
125+
telemetry: {
126+
enableTracing: true,
127+
endPoint: FAKE_URL,
128+
filters: [],
149129
},
150-
);
151-
}
130+
logLevel: 'warn',
131+
customPlugins: (options: Options, context: GlobalContext) =>
132+
debugFilesPlugins(context),
133+
};
134+
// This one is called at initialization, with the initial context.
135+
addMetricsMocked.mockImplementation(getAddMetricsImplem(metrics));
136+
cleanup = await runBundlers(pluginConfig, getComplexBuildOverrides(), activeBundlers);
137+
});
138+
139+
afterAll(async () => {
140+
await cleanup();
141+
});
142+
143+
test.each(expectations)(
144+
'$name - $version | Should get the related metrics',
145+
({ name, expectedMetrics }) => {
146+
const metricNames = metrics[name].map((metric) => metric.metric).sort();
147+
expect(metricNames).toEqual(expect.arrayContaining(expectedMetrics));
148+
},
149+
);
152150
});
153151

154152
describe('Without enableTracing', () => {

0 commit comments

Comments
 (0)