summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/astro/test/image-deletion.nodetest.js (renamed from packages/astro/test/image-deletion.test.js)9
-rw-r--r--packages/astro/test/import-app.nodetest.js (renamed from packages/astro/test/import-app.test.js)7
-rw-r--r--packages/astro/test/import-ts-with-js.nodetest.js (renamed from packages/astro/test/import-ts-with-js.test.js)5
-rw-r--r--packages/astro/test/impostor-mdx-file.nodetest.js (renamed from packages/astro/test/impostor-mdx-file.test.js)5
-rw-r--r--packages/astro/test/integration-add-page-extension.nodetest.js (renamed from packages/astro/test/integration-add-page-extension.test.js)5
-rw-r--r--packages/astro/test/integration-server-setup.nodetest.js (renamed from packages/astro/test/integration-server-setup.test.js)5
-rw-r--r--packages/astro/test/jsx.nodetest.js (renamed from packages/astro/test/jsx.test.js)31
7 files changed, 37 insertions, 30 deletions
diff --git a/packages/astro/test/image-deletion.test.js b/packages/astro/test/image-deletion.nodetest.js
index 2c92f2cec..d773a45b2 100644
--- a/packages/astro/test/image-deletion.test.js
+++ b/packages/astro/test/image-deletion.nodetest.js
@@ -1,4 +1,5 @@
-import { expect } from 'chai';
+import assert from 'node:assert/strict';
+import { describe, it, before } from 'node:test';
import { testImageService } from './test-image-service.js';
import { loadFixture } from './test-utils.js';
@@ -20,17 +21,17 @@ describe('astro:assets - delete images that are unused', () => {
it('should delete images that are only used for optimization', async () => {
const imagesOnlyOptimized = await fixture.glob('_astro/onlyone.*.*');
- expect(imagesOnlyOptimized).to.have.lengthOf(1);
+ assert.equal(imagesOnlyOptimized.length, 1);
});
it('should not delete images that are used in other contexts', async () => {
const imagesUsedElsewhere = await fixture.glob('_astro/twoofus.*.*');
- expect(imagesUsedElsewhere).to.have.lengthOf(2);
+ assert.equal(imagesUsedElsewhere.length, 2);
});
it('should not delete images that are also used through query params', async () => {
const imagesUsedElsewhere = await fixture.glob('_astro/url.*.*');
- expect(imagesUsedElsewhere).to.have.lengthOf(2);
+ assert.equal(imagesUsedElsewhere.length, 2);
});
});
});
diff --git a/packages/astro/test/import-app.test.js b/packages/astro/test/import-app.nodetest.js
index e0c76c5f8..45bbbbd45 100644
--- a/packages/astro/test/import-app.test.js
+++ b/packages/astro/test/import-app.nodetest.js
@@ -1,12 +1,13 @@
-import { expect } from 'chai';
+import assert from 'node:assert/strict';
+import { describe, it } from 'node:test';
describe('Import astro/app', async () => {
it('Successfully imports astro/app', async () => {
try {
await import('astro/app');
- expect(true).to.be.true;
+ assert.equal(true, true);
} catch (err) {
- expect.fail(undefined, undefined, `Importing astro/app should not throw an error: ${err}`);
+ assert.fail(undefined, undefined, `Importing astro/app should not throw an error: ${err}`);
}
});
});
diff --git a/packages/astro/test/import-ts-with-js.test.js b/packages/astro/test/import-ts-with-js.nodetest.js
index afe4a1618..2b72a61e0 100644
--- a/packages/astro/test/import-ts-with-js.test.js
+++ b/packages/astro/test/import-ts-with-js.nodetest.js
@@ -1,4 +1,5 @@
-import { expect } from 'chai';
+import assert from 'node:assert/strict';
+import { describe, before, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';
@@ -14,6 +15,6 @@ describe('Using .js extension on .ts file', () => {
it('works in .astro files', async () => {
const html = await fixture.readFile('/index.html');
const $ = cheerio.load(html);
- expect($('h1').text()).to.equal('bar');
+ assert.equal($('h1').text(), 'bar');
});
});
diff --git a/packages/astro/test/impostor-mdx-file.test.js b/packages/astro/test/impostor-mdx-file.nodetest.js
index 6f7147373..bb4dbf5f8 100644
--- a/packages/astro/test/impostor-mdx-file.test.js
+++ b/packages/astro/test/impostor-mdx-file.nodetest.js
@@ -1,4 +1,5 @@
-import { expect } from 'chai';
+import assert from 'node:assert/strict';
+import { describe, before, it, after } from 'node:test';
import { isWindows, loadFixture } from './test-utils.js';
let fixture;
@@ -25,7 +26,7 @@ describe('Impostor MDX File', () => {
it('does not crash when loading react component with .md or .mdx in name', async () => {
const result = await fixture.fetch('/').then((response) => response.text());
- expect(result).to.contain('Baz');
+ assert.equal(result.includes('Baz'), true);
});
});
});
diff --git a/packages/astro/test/integration-add-page-extension.test.js b/packages/astro/test/integration-add-page-extension.nodetest.js
index 28c11d4fc..f1e97d00e 100644
--- a/packages/astro/test/integration-add-page-extension.test.js
+++ b/packages/astro/test/integration-add-page-extension.nodetest.js
@@ -1,4 +1,5 @@
-import { expect } from 'chai';
+import assert from 'node:assert/strict';
+import { describe, before, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';
@@ -14,6 +15,6 @@ describe('Integration addPageExtension', () => {
it('supports .mjs files', async () => {
const html = await fixture.readFile('/test/index.html');
const $ = cheerio.load(html);
- expect($('h1').text()).to.equal('Hello world!');
+ assert.equal($('h1').text(), 'Hello world!');
});
});
diff --git a/packages/astro/test/integration-server-setup.test.js b/packages/astro/test/integration-server-setup.nodetest.js
index abe41d2bb..45f14d708 100644
--- a/packages/astro/test/integration-server-setup.test.js
+++ b/packages/astro/test/integration-server-setup.nodetest.js
@@ -1,4 +1,5 @@
-import { expect } from 'chai';
+import assert from 'node:assert/strict';
+import { describe, before, it, after } from 'node:test';
import { loadFixture } from './test-utils.js';
describe('Integration server setup', () => {
@@ -19,6 +20,6 @@ describe('Integration server setup', () => {
it('Adds middlewares in dev', async () => {
const res = await fixture.fetch('/');
- expect(res.headers.get('x-middleware')).to.equal('true');
+ assert.equal(res.headers.get('x-middleware'), 'true');
});
});
diff --git a/packages/astro/test/jsx.test.js b/packages/astro/test/jsx.nodetest.js
index b19074817..3b972a6eb 100644
--- a/packages/astro/test/jsx.test.js
+++ b/packages/astro/test/jsx.nodetest.js
@@ -1,4 +1,5 @@
-import { expect } from 'chai';
+import assert from 'node:assert/strict';
+import { describe, before, it } from 'node:test';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';
@@ -16,55 +17,55 @@ describe('jsx-runtime', () => {
const html = await fixture.readFile('/component/index.html');
const $ = cheerio.load(html);
- expect($('#basic').text()).to.equal('Basic');
- expect($('#named').text()).to.equal('Named');
+ assert.equal($('#basic').text(), 'Basic');
+ assert.equal($('#named').text(), 'Named');
});
it('Can load Preact component inside Astro', async () => {
const html = await fixture.readFile('/frameworks/index.html');
const $ = cheerio.load(html);
- expect($('#has-preact #preact').length).to.equal(0);
- expect($('#preact').text()).to.include('Preact');
+ assert.equal($('#has-preact #preact').length, 0);
+ assert.equal($('#preact').text().includes('Preact'), true);
});
it('Can load React component inside Astro', async () => {
const html = await fixture.readFile('/frameworks/index.html');
const $ = cheerio.load(html);
- expect($('#has-react #react').length).to.equal(0);
- expect($('#react').text()).to.include('React');
+ assert.equal($('#has-react #react').length, 0);
+ assert.equal($('#react').text().includes('React'), true);
});
it('Can load Solid component inside Astro', async () => {
const html = await fixture.readFile('/frameworks/index.html');
const $ = cheerio.load(html);
- expect($('#has-solid #solid').length).to.equal(0);
- expect($('#solid').text()).to.include('Solid');
+ assert.equal($('#has-solid #solid').length, 0);
+ assert.equal($('#solid').text().includes('Solid'), true);
});
it('Can load Svelte component inside Astro', async () => {
const html = await fixture.readFile('/frameworks/index.html');
const $ = cheerio.load(html);
- expect($('#has-svelte #svelte').length).to.equal(0);
- expect($('#svelte').text()).to.include('Svelte');
+ assert.equal($('#has-svelte #svelte').length, 0);
+ assert.equal($('#svelte').text().includes('Svelte'), true);
});
it('Can load Vue component inside Astro', async () => {
const html = await fixture.readFile('/frameworks/index.html');
const $ = cheerio.load(html);
- expect($('#has-vue #vue').length).to.equal(0);
- expect($('#vue').text()).to.include('Vue');
+ assert.equal($('#has-vue #vue').length, 0);
+ assert.equal($('#vue').text().includes('Vue'), true);
});
it('Can load MDX component inside Astro', async () => {
const html = await fixture.readFile('/frameworks/index.html');
const $ = cheerio.load(html);
- expect($('#mdx-wrapper #hello-world')).to.have.a.lengthOf(1, 'md content rendered');
- expect($('#mdx-wrapper #react')).to.have.a.lengthOf(1, 'React component rendered');
+ assert.equal($('#mdx-wrapper #hello-world').length, 1, 'md content rendered');
+ assert.equal($('#mdx-wrapper #react').length, 1, 'React component rendered');
});
});