aboutsummaryrefslogtreecommitdiff
path: root/packages/integrations/vercel/test/image.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/integrations/vercel/test/image.test.js')
-rw-r--r--packages/integrations/vercel/test/image.test.js23
1 files changed, 12 insertions, 11 deletions
diff --git a/packages/integrations/vercel/test/image.test.js b/packages/integrations/vercel/test/image.test.js
index b8bc3af95..af99afab1 100644
--- a/packages/integrations/vercel/test/image.test.js
+++ b/packages/integrations/vercel/test/image.test.js
@@ -1,5 +1,6 @@
-import { expect } from 'chai';
import * as cheerio from 'cheerio';
+import assert from 'node:assert/strict';
+import { after, before, describe, it } from 'node:test';
import { loadFixture } from './test-utils.js';
describe('Image', () => {
@@ -14,7 +15,7 @@ describe('Image', () => {
});
it('build successful', async () => {
- expect(await fixture.readFile('../.vercel/output/static/index.html')).to.be.ok;
+ assert.ok(await fixture.readFile('../.vercel/output/static/index.html'));
});
it('has link to vercel in build with proper attributes', async () => {
@@ -22,15 +23,15 @@ describe('Image', () => {
const $ = cheerio.load(html);
const img = $('#basic-image img');
- expect(img.attr('src').startsWith('/_vercel/image?url=_astr')).to.be.true;
- expect(img.attr('loading')).to.equal('lazy');
- expect(img.attr('width')).to.equal('225');
+ assert.equal(img.attr('src').startsWith('/_vercel/image?url=_astr'), true);
+ assert.equal(img.attr('loading'), 'lazy');
+ assert.equal(img.attr('width'), '225');
});
it('has proper vercel config', async () => {
const vercelConfig = JSON.parse(await fixture.readFile('../.vercel/output/config.json'));
- expect(vercelConfig.images).to.deep.equal({
+ assert.deepEqual(vercelConfig.images, {
sizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
domains: ['astro.build'],
remotePatterns: [
@@ -58,9 +59,9 @@ describe('Image', () => {
const $ = cheerio.load(html);
const img = $('#basic-image img');
- expect(img.attr('src').startsWith('/_image?href=')).to.be.true;
- expect(img.attr('loading')).to.equal('lazy');
- expect(img.attr('width')).to.equal('225');
+ assert.equal(img.attr('src').startsWith('/_image?href='), true);
+ assert.equal(img.attr('loading'), 'lazy');
+ assert.equal(img.attr('width'), '225');
});
it('supports SVGs', async () => {
@@ -70,8 +71,8 @@ describe('Image', () => {
const src = img.attr('src');
const res = await fixture.fetch(src);
- expect(res.status).to.equal(200);
- expect(res.headers.get('content-type')).to.equal('image/svg+xml');
+ assert.equal(res.status, 200);
+ assert.equal(res.headers.get('content-type'), 'image/svg+xml');
});
});
});