From 38e40f1cc245d8a755e8b498632bab49680db0a4 Mon Sep 17 00:00:00 2001 From: Atharva Date: Wed, 31 Jan 2024 20:28:44 +0530 Subject: chore(`@astrojs/vue`): use Node.js for testing (#9901) * chore: migrate vue tests to node * chore: prune chai/mocha from package-lock --- .../integrations/vue/test/app-entrypoint-css.test.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'packages/integrations/vue/test/app-entrypoint-css.test.js') diff --git a/packages/integrations/vue/test/app-entrypoint-css.test.js b/packages/integrations/vue/test/app-entrypoint-css.test.js index e454d6d0e..692008349 100644 --- a/packages/integrations/vue/test/app-entrypoint-css.test.js +++ b/packages/integrations/vue/test/app-entrypoint-css.test.js @@ -1,5 +1,6 @@ import { loadFixture } from './test-utils.js'; -import { expect } from 'chai'; +import * as assert from 'node:assert/strict'; +import { describe, it, before, after } from 'node:test'; import { load as cheerioLoad } from 'cheerio'; describe('App Entrypoint CSS', () => { @@ -22,18 +23,17 @@ describe('App Entrypoint CSS', () => { const $ = cheerioLoad(html); // test 1: basic component renders - expect($('#foo > #bar').text()).to.eq('works'); - + assert.equal($('#foo > #bar').text(), 'works'); // test 2: injects the global style on the page - expect($('style').first().text().trim()).to.eq(':root{background-color:red}'); + assert.equal($('style').first().text().trim(), ':root{background-color:red}'); }); it('does not inject styles to pages without a Vue component', async () => { const html = await fixture.readFile('/unrelated/index.html'); const $ = cheerioLoad(html); - expect($('style').length).to.eq(0); - expect($('link[rel="stylesheet"]').length).to.eq(0); + assert.equal($('style').length, 0); + assert.equal($('link[rel="stylesheet"]').length, 0); }); }); @@ -51,17 +51,17 @@ describe('App Entrypoint CSS', () => { const $ = cheerioLoad(html); // test 1: basic component renders - expect($('#foo > #bar').text()).to.eq('works'); + assert.equal($('#foo > #bar').text(), 'works'); // test 2: injects the global style on the page - expect($('style').first().text().replace(/\s+/g, '')).to.eq(':root{background-color:red;}'); + assert.equal($('style').first().text().replace(/\s+/g, ''), ':root{background-color:red;}'); }); it('does not inject styles to pages without a Vue component', async () => { const html = await fixture.fetch('/unrelated').then((res) => res.text()); const $ = cheerioLoad(html); - expect($('style').length).to.eq(0); - expect($('link[rel="stylesheet"]').length).to.eq(0); + assert.equal($('style').length, 0); + assert.equal($('link[rel="stylesheet"]').length, 0); }); }); }); -- cgit v1.2.3