Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1e2af1f

Browse files
authored
test: check booleans as well (#37)
- so all the most basic primitives are covered now (string, number, boolean) - checks against an issue report as well
1 parent9442279 commit1e2af1f

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"build":"tsdx build",
3232
"tsc":"tsc --noEmit --skipLibCheck",
3333
"test":"tsdx test",
34+
"test:watch":"tsdx test --watch",
3435
"test:coverage":"tsdx test --coverage",
3536
"test:pub":"npm run build && npm pack",
3637
"pub":"npm run build && npm publish",

‎test/fixtures.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import { types } from 'mobx-state-tree'
22

33
exportconstUserStoreF=types.model('UserStore',{
44
name:'John Doe',
5-
age:32
5+
age:32,
6+
hasDogs:true,
67
}).actions((self)=>({
78
changeName(name:string){
89
self.name=name
@@ -11,5 +12,6 @@ export const UserStoreF = types.model('UserStore', {
1112

1213
exportconstpersistedDataF={
1314
name:'Persisted Name',
14-
age:35
15+
age:35,
16+
hasDogs:false,
1517
}

‎test/index.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ describe('persist options', () => {
5353
it('should whitelist',async()=>{
5454
constuser=UserStoreF.create()
5555
awaitpersist('user',user,{
56-
whitelist:['name']
56+
whitelist:['name','hasDogs']
5757
})
5858

5959
user.changeName('Joe')// fire action to trigger onSnapshot

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp