Add karma based testing

This commit is contained in:
lukasmartinelli
2016-11-23 14:38:09 +01:00
parent b3d355957d
commit 824821f2c8
5 changed files with 56 additions and 3 deletions

16
test/stylestore_test.js Normal file
View File

@@ -0,0 +1,16 @@
import { SettingsStore } from '../src/stylestore.js'
import assert from 'assert'
describe('SettingsStore', () => {
const store = new SettingsStore()
it('#get should return access token from local storage', () => {
window.localStorage.setItem('maputnik:access_token', 'OLD_TOKEN')
assert.equal(store.accessToken, 'OLD_TOKEN')
})
it('#set should set access token in local storage', () => {
store.accessToken = 'NEW_TOKEN'
assert.equal(window.localStorage.getItem('maputnik:access_token'), 'NEW_TOKEN')
})
})