diff --git a/test/build-test.ts b/test/build-test.ts index b477d58fd..aade58fd6 100644 --- a/test/build-test.ts +++ b/test/build-test.ts @@ -2,9 +2,10 @@ import assert from "node:assert"; import {existsSync, readdirSync, statSync} from "node:fs"; import {mkdir, mkdtemp, open, readFile, rename, rm, unlink, writeFile} from "node:fs/promises"; import os from "node:os"; +import {extname} from "node:path/posix"; import {join, normalize, relative} from "node:path/posix"; import {PassThrough} from "node:stream"; -import {ascending, difference} from "d3-array"; +import {ascending, difference, sort} from "d3-array"; import type {BuildManifest} from "../src/build.js"; import {FileBuildEffects, build} from "../src/build.js"; import {normalizeConfig, readConfig, setCurrentDate} from "../src/config.js"; @@ -76,7 +77,10 @@ describe("build", () => { // renumber the hashes so they are sequential. This way we don’t have to // update the test snapshots whenever Framework’s client code changes. We // make an exception for minisearch.json because to test the content. - for (const path of findFiles(join(outputDir, "_observablehq"))) { + for (const path of sort( + findFiles(join(outputDir, "_observablehq")), + (a, b) => ascending(extname(a) === ".css", extname(b) === ".css") || ascending(a, b) + )) { const match = /^((.+)\.[0-9a-f]{8})\.(\w+)$/.exec(path); if (!match) throw new Error(`no hash found: ${path}`); const [, key, name, ext] = match; diff --git a/test/output/build/duckdb/_observablehq/stdlib/duckdb.00000005.js b/test/output/build/duckdb/_observablehq/stdlib/duckdb.00000004.js similarity index 100% rename from test/output/build/duckdb/_observablehq/stdlib/duckdb.00000005.js rename to test/output/build/duckdb/_observablehq/stdlib/duckdb.00000004.js diff --git a/test/output/build/npm/_observablehq/stdlib/inputs.00000005.js b/test/output/build/duckdb/_observablehq/stdlib/inputs.00000005.js similarity index 100% rename from test/output/build/npm/_observablehq/stdlib/inputs.00000005.js rename to test/output/build/duckdb/_observablehq/stdlib/inputs.00000005.js diff --git a/test/output/build/npm/_observablehq/stdlib/inputs.00000006.css b/test/output/build/duckdb/_observablehq/stdlib/inputs.00000006.css similarity index 100% rename from test/output/build/npm/_observablehq/stdlib/inputs.00000006.css rename to test/output/build/duckdb/_observablehq/stdlib/inputs.00000006.css diff --git a/test/output/build/duckdb/_observablehq/stdlib/inputs.00000006.js b/test/output/build/duckdb/_observablehq/theme-air,near-midnight.00000007.css similarity index 100% rename from test/output/build/duckdb/_observablehq/stdlib/inputs.00000006.js rename to test/output/build/duckdb/_observablehq/theme-air,near-midnight.00000007.css diff --git a/test/output/build/duckdb/index.html b/test/output/build/duckdb/index.html index b0ceaf67b..d470ee724 100644 --- a/test/output/build/duckdb/index.html +++ b/test/output/build/duckdb/index.html @@ -7,16 +7,16 @@ test DuckDB - - + + - - + + - - + + diff --git a/test/output/build/npm/_import/index.4bdc071f.js b/test/output/build/npm/_import/index.4bdc071f.js index 108b15a25..bddccaad0 100644 --- a/test/output/build/npm/_import/index.4bdc071f.js +++ b/test/output/build/npm/_import/index.4bdc071f.js @@ -1 +1 @@ -import "../_observablehq/stdlib/inputs.00000005.js"; +import "../_observablehq/stdlib/inputs.00000004.js"; diff --git a/test/output/build/duckdb/_observablehq/stdlib/inputs.00000007.css b/test/output/build/npm/_observablehq/stdlib/inputs.00000004.js similarity index 100% rename from test/output/build/duckdb/_observablehq/stdlib/inputs.00000007.css rename to test/output/build/npm/_observablehq/stdlib/inputs.00000004.js diff --git a/test/output/build/duckdb/_observablehq/theme-air,near-midnight.00000004.css b/test/output/build/npm/_observablehq/stdlib/inputs.00000005.css similarity index 100% rename from test/output/build/duckdb/_observablehq/theme-air,near-midnight.00000004.css rename to test/output/build/npm/_observablehq/stdlib/inputs.00000005.css diff --git a/test/output/build/npm/_observablehq/theme-air,near-midnight.00000004.css b/test/output/build/npm/_observablehq/theme-air,near-midnight.00000006.css similarity index 100% rename from test/output/build/npm/_observablehq/theme-air,near-midnight.00000004.css rename to test/output/build/npm/_observablehq/theme-air,near-midnight.00000006.css diff --git a/test/output/build/npm/index.html b/test/output/build/npm/index.html index 64771f980..a14a21894 100644 --- a/test/output/build/npm/index.html +++ b/test/output/build/npm/index.html @@ -6,16 +6,16 @@ - - + + - - + + - +