summaryrefslogtreecommitdiff
path: root/packages/integrations/vue/test/app-entrypoint-css.test.js
diff options
context:
space:
mode:
authorGravatar Atharva <atharvapise19@gmail.com> 2024-01-31 20:28:44 +0530
committerGravatar GitHub <noreply@github.com> 2024-01-31 14:58:44 +0000
commit38e40f1cc245d8a755e8b498632bab49680db0a4 (patch)
treef69d157c4b6f42cb93ad1f9e52114259d75a56c8 /packages/integrations/vue/test/app-entrypoint-css.test.js
parent694fd867395423f20b0e8604f4031ac6633cf706 (diff)
downloadastro-38e40f1cc245d8a755e8b498632bab49680db0a4.tar.gz
astro-38e40f1cc245d8a755e8b498632bab49680db0a4.tar.zst
astro-38e40f1cc245d8a755e8b498632bab49680db0a4.zip
chore(`@astrojs/vue`): use Node.js for testing (#9901)
* chore: migrate vue tests to node * chore: prune chai/mocha from package-lock
Diffstat (limited to 'packages/integrations/vue/test/app-entrypoint-css.test.js')
-rw-r--r--packages/integrations/vue/test/app-entrypoint-css.test.js20
1 files changed, 10 insertions, 10 deletions
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);
});
});
});