Skip to content

Commit 7e6972a

Browse files
committed
test: improve resilience of asset timestamp E2E test
1 parent 5c9b371 commit 7e6972a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ jobs:
161161

162162
e2e-snapshots:
163163
needs: [analyze, build]
164-
if: needs.analyze.outputs.snapshots == 'true'
164+
# if: needs.analyze.outputs.snapshots == 'true'
165165
strategy:
166166
fail-fast: false
167167
matrix:

tests/legacy-cli/e2e/tests/build/assets.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const isNodeV22orHigher = Number(process.versions.node.split('.', 1)[0]) >= 22;
1111
export default async function () {
1212
await writeFile('public/.file', '');
1313
await writeFile('public/test.abc', 'hello world');
14-
const originalStats = fs.statSync('public/test.abc', { bigint: true });
1514

1615
await ng('build', '--configuration=development');
1716

@@ -22,9 +21,11 @@ export default async function () {
2221

2322
// Timestamp preservation only supported with application build system on Node.js v22+
2423
if (isNodeV22orHigher && getGlobalVariable('argv')['esbuild']) {
24+
const originalStats = fs.statSync('public/test.abc', { bigint: true });
2525
const outputStats = fs.statSync('dist/test-project/browser/test.abc', { bigint: true });
26-
assert(
27-
originalStats.mtimeMs === outputStats.mtimeMs,
26+
assert.equal(
27+
originalStats.mtimeMs,
28+
outputStats.mtimeMs,
2829
'Asset file modified timestamp should be preserved.',
2930
);
3031
}

0 commit comments

Comments
 (0)