diff --git a/package.json b/package.json index 0caa78a..c8dec7c 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "build": "tsdx build", "tsc": "tsc --noEmit --skipLibCheck", "test": "tsdx test", + "test:watch": "tsdx test --watch", "test:coverage": "tsdx test --coverage", "test:pub": "npm run build && npm pack", "pub": "npm run build && npm publish", diff --git a/test/fixtures.ts b/test/fixtures.ts index 1b110a1..d829971 100644 --- a/test/fixtures.ts +++ b/test/fixtures.ts @@ -2,7 +2,8 @@ import { types } from 'mobx-state-tree' export const UserStoreF = types.model('UserStore', { name: 'John Doe', - age: 32 + age: 32, + hasDogs: true, }).actions((self) => ({ changeName(name: string) { self.name = name @@ -11,5 +12,6 @@ export const UserStoreF = types.model('UserStore', { export const persistedDataF = { name: 'Persisted Name', - age: 35 + age: 35, + hasDogs: false, } diff --git a/test/index.spec.ts b/test/index.spec.ts index fcd7c62..2c1cb4b 100644 --- a/test/index.spec.ts +++ b/test/index.spec.ts @@ -53,7 +53,7 @@ describe('persist options', () => { it('should whitelist', async () => { const user = UserStoreF.create() await persist('user', user, { - whitelist: ['name'] + whitelist: ['name', 'hasDogs'] }) user.changeName('Joe') // fire action to trigger onSnapshot