[ci] format
This commit is contained in:
parent
b3e65991f7
commit
43ec7f374a
6 changed files with 17 additions and 8 deletions
|
@ -1,9 +1,9 @@
|
||||||
import type { AstroConfig } from 'astro';
|
import type { AstroConfig } from 'astro';
|
||||||
import MagicString from 'magic-string';
|
import MagicString from 'magic-string';
|
||||||
import fs from 'node:fs/promises';
|
import fs from 'node:fs/promises';
|
||||||
import { basename, extname, join } from 'node:path';
|
import { basename, extname } from 'node:path';
|
||||||
import { Readable } from 'node:stream';
|
import { Readable } from 'node:stream';
|
||||||
import { fileURLToPath, pathToFileURL } from 'node:url';
|
import { pathToFileURL } from 'node:url';
|
||||||
import type { Plugin, ResolvedConfig } from 'vite';
|
import type { Plugin, ResolvedConfig } from 'vite';
|
||||||
import type { IntegrationOptions } from './index.js';
|
import type { IntegrationOptions } from './index.js';
|
||||||
import type { InputFormat } from './loaders/index.js';
|
import type { InputFormat } from './loaders/index.js';
|
||||||
|
|
|
@ -7,7 +7,8 @@ import { join } from 'node:path';
|
||||||
import { loadFixture } from './test-utils.js';
|
import { loadFixture } from './test-utils.js';
|
||||||
|
|
||||||
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
||||||
const toAstroImage = (relpath) => '/@astroimage' + pathToFileURL(join(__dirname, 'fixtures/basic-image', relpath)).pathname;
|
const toAstroImage = (relpath) =>
|
||||||
|
'/@astroimage' + pathToFileURL(join(__dirname, 'fixtures/basic-image', relpath)).pathname;
|
||||||
|
|
||||||
describe('SSG images - dev', function () {
|
describe('SSG images - dev', function () {
|
||||||
let fixture;
|
let fixture;
|
||||||
|
@ -234,7 +235,11 @@ describe('SSG images - build', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
function verifyImage(pathname, expected) {
|
function verifyImage(pathname, expected) {
|
||||||
const dist = join(fileURLToPath(new URL('.', import.meta.url)), 'fixtures/basic-image/dist', pathname);
|
const dist = join(
|
||||||
|
fileURLToPath(new URL('.', import.meta.url)),
|
||||||
|
'fixtures/basic-image/dist',
|
||||||
|
pathname
|
||||||
|
);
|
||||||
const result = sizeOf(dist);
|
const result = sizeOf(dist);
|
||||||
expect(result).to.deep.equal(expected);
|
expect(result).to.deep.equal(expected);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,8 @@ import { loadFixture } from './test-utils.js';
|
||||||
import testAdapter from '../../../astro/test/test-adapter.js';
|
import testAdapter from '../../../astro/test/test-adapter.js';
|
||||||
|
|
||||||
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
||||||
const toAstroImage = (relpath) => '/@astroimage' + pathToFileURL(join(__dirname, 'fixtures/basic-image', relpath)).pathname;
|
const toAstroImage = (relpath) =>
|
||||||
|
'/@astroimage' + pathToFileURL(join(__dirname, 'fixtures/basic-image', relpath)).pathname;
|
||||||
|
|
||||||
describe('SSR images - dev', function () {
|
describe('SSR images - dev', function () {
|
||||||
let fixture;
|
let fixture;
|
||||||
|
|
|
@ -8,7 +8,8 @@ import { join } from 'node:path';
|
||||||
import { loadFixture } from './test-utils.js';
|
import { loadFixture } from './test-utils.js';
|
||||||
|
|
||||||
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
||||||
const toAstroImage = (relpath) => '/@astroimage' + pathToFileURL(join(__dirname, 'fixtures/basic-picture', relpath)).pathname;
|
const toAstroImage = (relpath) =>
|
||||||
|
'/@astroimage' + pathToFileURL(join(__dirname, 'fixtures/basic-picture', relpath)).pathname;
|
||||||
|
|
||||||
describe('SSG pictures - dev', function () {
|
describe('SSG pictures - dev', function () {
|
||||||
let fixture;
|
let fixture;
|
||||||
|
|
|
@ -6,7 +6,8 @@ import { loadFixture } from './test-utils.js';
|
||||||
import testAdapter from '../../../astro/test/test-adapter.js';
|
import testAdapter from '../../../astro/test/test-adapter.js';
|
||||||
|
|
||||||
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
||||||
const toAstroImage = (relpath) => '/@astroimage' + pathToFileURL(join(__dirname, 'fixtures/basic-picture', relpath)).pathname;
|
const toAstroImage = (relpath) =>
|
||||||
|
'/@astroimage' + pathToFileURL(join(__dirname, 'fixtures/basic-picture', relpath)).pathname;
|
||||||
|
|
||||||
describe('SSR pictures - dev', function () {
|
describe('SSR pictures - dev', function () {
|
||||||
let fixture;
|
let fixture;
|
||||||
|
|
|
@ -5,7 +5,8 @@ import { join } from 'node:path';
|
||||||
import { loadFixture } from './test-utils.js';
|
import { loadFixture } from './test-utils.js';
|
||||||
|
|
||||||
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
||||||
const toAstroImage = (relpath) => '/@astroimage' + pathToFileURL(join(__dirname, 'fixtures/squoosh-service', relpath)).pathname;
|
const toAstroImage = (relpath) =>
|
||||||
|
'/@astroimage' + pathToFileURL(join(__dirname, 'fixtures/squoosh-service', relpath)).pathname;
|
||||||
|
|
||||||
describe('Squoosh service', function () {
|
describe('Squoosh service', function () {
|
||||||
let fixture;
|
let fixture;
|
||||||
|
|
Loading…
Add table
Reference in a new issue