Skip to content

Commit

Permalink
test(core-common): migrate to vitest test functions
Browse files Browse the repository at this point in the history
One of the `get-renderer-name` tests is failing, but this goes uncaught
since vitest does not understand node's test runner output.

This basically moves to using `it` from vitest rather than `node:test`,
thus introducing a failing test. The failing test has then been fixed.
  • Loading branch information
43081j committed May 8, 2024
1 parent 8787873 commit 0245d8b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions code/lib/core-common/src/utils/get-renderer-name.test.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { it } from 'node:test';
import { describe, expect } from 'vitest';
import { describe, expect, test } from 'vitest';
import { extractProperRendererNameFromFramework } from './get-renderer-name';

describe('get-renderer-name', () => {
describe('extractProperRendererNameFromFramework', () => {
it('should return the renderer name for a known framework', async () => {
const renderer = await extractProperRendererNameFromFramework('@storybook/react');
test('should return the renderer name for a known framework', async () => {
const renderer = await extractProperRendererNameFromFramework('@storybook/react-vite');
expect(renderer).toEqual('react');
});

it('should return null for an unknown framework', async () => {
test('should return null for an unknown framework', async () => {
const renderer = await extractProperRendererNameFromFramework('@third-party/framework');
expect(renderer).toBeNull();
});
Expand Down

0 comments on commit 0245d8b

Please sign in to comment.