UNPKG

793 BJavaScriptView Raw
1/**
2 * Test case for apPreferenceService.
3 * Runs with mocha.
4 */
5'use strict'
6
7const ApPreferenceService = require('../lib/ap_preference_service.js')
8const { createStore } = require('redux')
9const { reducer } = require('apeman-service-base')
10const assert = require('assert')
11const co = require('co')
12
13describe('ap-preference-service', function () {
14 this.timeout(3000)
15
16 before(() => co(function * () {
17
18 }))
19
20 after(() => co(function * () {
21
22 }))
23
24 it('Do service', () => co(function * () {
25 let store = createStore(reducer)
26 let service = new ApPreferenceService(store)
27 assert.ok(service)
28 yield service.setPreference('foo', 'This is foo')
29 let foo = service.getPreference('foo')
30 assert.equal(foo, 'This is foo')
31 }))
32})
33
34/* global describe, before, after, it */