1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-06 18:18:53 +08:00

restore sinon

This commit is contained in:
lana-k
2021-02-12 21:47:39 +01:00
parent 896b8af1a2
commit 36f0809546

View File

@@ -4,6 +4,10 @@ import * as chart from '@/chart'
import * as dereference from 'react-chart-editor/lib/lib/dereference'
describe('chart.js', () => {
afterEach(() => {
sinon.restore()
})
it('getDataSourcesFromSqlResult', () => {
const sqlResult = {
columns: ['id', 'name'],
@@ -47,6 +51,7 @@ describe('chart.js', () => {
name: ['foo', 'bar']
}
sinon.stub(dereference, 'default')
sinon.spy(JSON, 'parse')
const ds = chart.getChartStateForSave(state, dataSources)
@@ -61,5 +66,7 @@ describe('chart.js', () => {
id: [],
name: []
})
expect(ds).to.equal(JSON.parse.returnValues[0])
})
})