summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar lilnasy <lilnasy@users.noreply.github.com> 2023-09-05 18:03:21 +0000
committerGravatar astrobot-houston <fred+astrobot@astro.build> 2023-09-05 18:03:21 +0000
commitcde0cc409383e2e3fcb6b2bded432bad8d7c40ab (patch)
tree4da976e90dea8e3b333d64d3ba12462e7133e416
parent7d95bd9baaf755239fd7d35e4813861b2dbccf42 (diff)
downloadastro-cde0cc409383e2e3fcb6b2bded432bad8d7c40ab.tar.gz
astro-cde0cc409383e2e3fcb6b2bded432bad8d7c40ab.tar.zst
astro-cde0cc409383e2e3fcb6b2bded432bad8d7c40ab.zip
[ci] format
-rw-r--r--.eslintrc.cjs5
-rw-r--r--packages/astro/test/css-dangling-references.test.js50
2 files changed, 29 insertions, 26 deletions
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
index 9a6436767..ad881979b 100644
--- a/.eslintrc.cjs
+++ b/.eslintrc.cjs
@@ -13,7 +13,10 @@ module.exports = {
rules: {
// These off/configured-differently-by-default rules fit well for us
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
- '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: "^_", ignoreRestSiblings: true }],
+ '@typescript-eslint/no-unused-vars': [
+ 'error',
+ { argsIgnorePattern: '^_', ignoreRestSiblings: true },
+ ],
'no-only-tests/no-only-tests': 'error',
'@typescript-eslint/no-shadow': ['error'],
'no-console': 'warn',
diff --git a/packages/astro/test/css-dangling-references.test.js b/packages/astro/test/css-dangling-references.test.js
index 4f3c6e77d..c38aa854d 100644
--- a/packages/astro/test/css-dangling-references.test.js
+++ b/packages/astro/test/css-dangling-references.test.js
@@ -1,36 +1,36 @@
import { expect } from 'chai';
import { loadFixture } from './test-utils.js';
-const cssAssetReferenceRegExp = /_astro\/[A-Za-z0-9\-]+\.[a0-9a-f]{8}\.css/g
+const cssAssetReferenceRegExp = /_astro\/[A-Za-z0-9\-]+\.[a0-9a-f]{8}\.css/g;
describe("When Vite's preloadModule polyfill is used", async () => {
-
- let fixture;
+ let fixture;
before(async () => {
fixture = await loadFixture({
- root: './fixtures/css-dangling-references/'
- });
+ root: './fixtures/css-dangling-references/',
+ });
await fixture.build();
});
- it('there are no references to deleted CSS chunks', async () => {
-
- const fileNames = await fixture.readdir('/_astro/')
- const filePaths = fileNames.map(filename => '_astro/' + filename)
-
- const expectations =
- filePaths
- .filter(filePath => filePath.endsWith('js'))
- .map(async filePath => {
- const contents = await fixture.readFile(filePath)
- const cssReferences = contents.match(cssAssetReferenceRegExp)
-
- if (cssReferences === null) return
-
- expect(filePaths).to.contain.members(cssReferences, filePath + ' contains a reference to a deleted css asset: ' + cssReferences)
- })
-
- await Promise.all(expectations)
- })
-}) \ No newline at end of file
+ it('there are no references to deleted CSS chunks', async () => {
+ const fileNames = await fixture.readdir('/_astro/');
+ const filePaths = fileNames.map((filename) => '_astro/' + filename);
+
+ const expectations = filePaths
+ .filter((filePath) => filePath.endsWith('js'))
+ .map(async (filePath) => {
+ const contents = await fixture.readFile(filePath);
+ const cssReferences = contents.match(cssAssetReferenceRegExp);
+
+ if (cssReferences === null) return;
+
+ expect(filePaths).to.contain.members(
+ cssReferences,
+ filePath + ' contains a reference to a deleted css asset: ' + cssReferences
+ );
+ });
+
+ await Promise.all(expectations);
+ });
+});