0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-06 22:10:10 -05:00

chore: migrate static-build-vite-plugins.test.js to node:test (#10050)

This commit is contained in:
Ming-jun Lu 2024-02-08 18:16:53 +08:00 committed by GitHub
parent aef8730f65
commit 322b2b6c72
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,4 +1,5 @@
import { expect } from 'chai';
import assert from 'node:assert/strict';
import { before, describe, it } from 'node:test';
import { loadFixture } from './test-utils.js';
describe('Static build: vite plugins included when required', () => {
@ -74,15 +75,9 @@ describe('Static build: vite plugins included when required', () => {
await fixture.build();
});
it('Vite Plugins are included/excluded properly', async () => {
expect(pluginsCalled.size).to.equal(
expectedPluginResult.size,
'Not all plugins were initialized'
);
assert.equal(pluginsCalled.size, expectedPluginResult.size, 'Not all plugins were initialized');
Array.from(expectedPluginResult.entries()).forEach(([plugin, called]) =>
expect(pluginsCalled.get(plugin)).to.equal(
called,
`${plugin} was ${called ? 'not' : ''} called`
)
assert.equal(pluginsCalled.get(plugin), called, `${plugin} was ${called ? 'not' : ''} called`)
);
});
});