Prerequisites
Stencil Version
4.43.5
Current Behavior
When running test using vitest with a dist-custom-elements output target I get the following error after the test run:
SyntaxError: The "st:app:start" performance mark has not been set
❯ getMark node:internal/perf/usertiming:65:11
❯ calculateStartDuration node:internal/perf/usertiming:212:13
❯ measure node:internal/perf/usertiming:230:7
❯ Performance.measure node:internal/perf/performance:134:12
❯ appDidLoad dist/components/node_modules/@stencil/core/internal/client/index.js:3456:17
❯ postUpdateComponent dist/components/node_modules/@stencil/core/internal/client/index.js:3404:9
❯ postUpdate dist/components/node_modules/@stencil/core/internal/client/index.js:3323:30
❯ updateComponent dist/components/node_modules/@stencil/core/internal/client/index.js:3325:7
❯ dist/components/node_modules/@stencil/core/internal/client/index.js:3273:38
❯ enqueue dist/components/node_modules/@stencil/core/internal/client/index.js:3278:6
This happen even if the test succeeds.
Expected Behavior
The test runs without error when test succeeds.
System Info
Steps to Reproduce
Use the following stencil.config.ts:
export const config: Config = {
buildDist: true,
outputTargets: [
{
type: 'dist-custom-elements',
externalRuntime: false
}
]
};
The error occur if externalRuntime is false.
vitest.config.mts
import { defineVitestConfig } from '@stencil/vitest/config';
export default defineVitestConfig({
stencilConfig: './stencil.config.ts',
test: {
projects: [
{
test: {
name: 'spec',
include: ['test/**/*.spec.{ts,tsx}'],
environment: 'stencil',
setupFiles: ['./vitest-setup.mts'],
},
}
],
},
});
vitest-setup.mts:
import { defineCustomElement} from "./dist/components/prefix-component.js";
defineCustomElement();
Run npx stencil-test --project spec.
Code Reproduction URL
?
Additional Information
If I put performance.mark('st:app:start'); in vitest-setup.mts I no longer trigger the error.
Prerequisites
Stencil Version
4.43.5
Current Behavior
When running test using vitest with a dist-custom-elements output target I get the following error after the test run:
This happen even if the test succeeds.
Expected Behavior
The test runs without error when test succeeds.
System Info
Steps to Reproduce
Use the following
stencil.config.ts:The error occur if
externalRuntimeis false.vitest.config.mtsvitest-setup.mts:Run
npx stencil-test --project spec.Code Reproduction URL
?
Additional Information
If I put
performance.mark('st:app:start');invitest-setup.mtsI no longer trigger the error.