aboutsummaryrefslogtreecommitdiffstats
path: root/test/lib/mock-config-manager.js
blob: c62d91da90221fb42b058564bea6efd266efec88 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
const ConfigManager = require('../../app/scripts/lib/config-manager')
const LocalStorageStore = require('../../app/scripts/lib/observable/local-storage')
const firstTimeState = require('../../app/scripts/first-time-state')
const STORAGE_KEY = 'metamask-config'

module.exports = function() {
  let dataStore = new LocalStorageStore({ storageKey: STORAGE_KEY })
  // initial state for first time users
  if (!dataStore.get()) dataStore.put(firstTimeState)
  return new ConfigManager({ store: dataStore })
}