Skip to content

Commit

Permalink
avoid generating assets in unrelated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bakkot committed Aug 30, 2023
1 parent 331959e commit e69e569
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/biblio.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ describe('Biblio', () => {
`,
{
copyright: false,
assets: 'none',
location: 'https://example.com/spec/',
warn: e => {
console.error('Error:', e);
Expand Down Expand Up @@ -142,6 +143,7 @@ describe('Biblio', () => {
`,
{
copyright: false,
assets: 'none',
location: 'https://example.com/spec/',
warn: e => {
console.error('Error:', e);
Expand Down
2 changes: 2 additions & 0 deletions test/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ ${M} </pre>
};
await emu.build('foo/index.html', fetch, {
copyright: false,
assets: 'none',
warn: e =>
warnings.push({
ruleId: e.ruleId,
Expand Down Expand Up @@ -1050,6 +1051,7 @@ ${M} </pre>
const fetch = () => '';
await emu.build('index.html', fetch, {
copyright: false,
assets: 'none',
extraBiblios: [{ 'https://tc39.es/ecma262/': [] }],
});
}, /old-style biblio/);
Expand Down
4 changes: 4 additions & 0 deletions test/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ async function assertError(obj, { ruleId, nodeType, message }, opts) {
if (opts?.asImport !== 'only') {
await emu.build(rootFile, async () => html, {
copyright: false,
assets: 'none',
warn: e =>
warnings.push({
ruleId: e.ruleId,
Expand Down Expand Up @@ -72,6 +73,7 @@ async function assertError(obj, { ruleId, nodeType, message }, opts) {
let fetch = name => (name === rootFile ? importWrapper : html);
await emu.build(rootFile, fetch, {
copyright: false,
assets: 'none',
warn: e =>
warnings.push({
ruleId: e.ruleId,
Expand Down Expand Up @@ -112,6 +114,7 @@ async function assertErrorFree(html, opts) {

await emu.build('test-example.emu', async () => html, {
copyright: false,
assets: 'none',
warn: e => warnings.push(e),
...opts,
});
Expand All @@ -129,6 +132,7 @@ async function assertLintFree(html, opts = {}) {

async function getBiblio(html) {
let upstream = await emu.build('root.html', () => html, {
assets: 'none',
location: 'https://example.com/spec/',
});
return upstream.exportBiblio();
Expand Down

0 comments on commit e69e569

Please sign in to comment.