-
Notifications
You must be signed in to change notification settings - Fork 627
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
start switching to vitest for esm support
- Loading branch information
Showing
13 changed files
with
202 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import {describe, expect, it} from 'vitest'; | ||
import {TopLevelSpec} from '../src/index.js'; | ||
import {embed} from './util.js'; | ||
|
||
describe('Basic', () => { | ||
it('should render a chart', async () => { | ||
const spec: TopLevelSpec = { | ||
mark: 'bar', | ||
data: { | ||
values: [ | ||
{a: 'A', b: 28}, | ||
{a: 'B', b: 55}, | ||
{a: 'C', b: 43}, | ||
{a: 'D', b: 91}, | ||
{a: 'E', b: 81}, | ||
{a: 'F', b: 53}, | ||
{a: 'G', b: 19}, | ||
{a: 'H', b: 87}, | ||
{a: 'I', b: 52}, | ||
], | ||
}, | ||
encoding: { | ||
x: {field: 'a'}, | ||
y: {field: 'b', type: 'quantitative'}, | ||
}, | ||
}; | ||
|
||
const view = await embed(spec); | ||
|
||
const svg = await view.toSVG(); | ||
|
||
await expect(svg).toMatchFileSnapshot('./snapshots/basic.svg'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.