11import test from 'ava'
2- import { createStore , TYPE } from '../src'
2+ import { createStore , TYPE } from '../src/index.js '
33
44test ( 'createStore' , function ( t ) {
55 const state = { number : 1 }
@@ -19,8 +19,8 @@ test('createStore', function (t) {
1919test ( 'subscribe' , function ( t ) {
2020 const state = { prop : true }
2121 const store = createStore ( state )
22- const listener = ( ) => { }
23- const filter = ( ) => { }
22+ const listener = ( ) => { }
23+ const filter = ( ) => { }
2424 store . subscribe ( listener , filter )
2525 t . true ( store . listeners . has ( listener ) )
2626 t . is ( store . listeners . get ( listener ) , filter )
@@ -33,7 +33,7 @@ test('subscribe', function (t) {
3333test ( 'unsubscribe from subscribe' , function ( t ) {
3434 const state = { prop : true }
3535 const store = createStore ( state )
36- const listener = ( ) => { }
36+ const listener = ( ) => { }
3737 const unsubscribe = store . subscribe ( listener )
3838 t . true ( store . listeners . has ( listener ) )
3939 t . is ( store . listeners . size , 1 )
@@ -45,7 +45,7 @@ test('unsubscribe from subscribe', function (t) {
4545test ( 'unsubscribe' , function ( t ) {
4646 const state = { prop : true }
4747 const store = createStore ( state )
48- const listener = ( ) => { }
48+ const listener = ( ) => { }
4949 store . subscribe ( listener )
5050 t . true ( store . listeners . has ( listener ) )
5151 t . is ( store . listeners . size , 1 )
@@ -58,7 +58,7 @@ test('applyPatch', function (t) {
5858 const state = { prop : false }
5959 const store = createStore ( state )
6060 const patch = { prop : true }
61- const listener = ( p ) => { }
61+ const listener = ( p ) => { }
6262 store . subscribe ( listener )
6363 const outputs = store . applyPatch ( patch )
6464 t . true ( Array . isArray ( outputs ) )
@@ -78,7 +78,7 @@ test('applyPatch', function (t) {
7878test ( 'applyPatch with function' , function ( t ) {
7979 const state = { prop : false }
8080 const store = createStore ( state )
81- const listener = ( p ) => { }
81+ const listener = ( p ) => { }
8282 store . subscribe ( listener )
8383 const outputs = store . applyPatch ( ( draft ) => {
8484 draft . prop = true
@@ -100,7 +100,7 @@ test('subscribe filter', function (t) {
100100 const store = createStore ( initialstate )
101101 const patch = { prop : true , newprop : true }
102102 const filter = ( mutation ) => mutation . prop !== 'newprop'
103- store . subscribe ( ( ) => { } , filter )
103+ store . subscribe ( ( ) => { } , filter )
104104 const result = store . applyPatch ( patch )
105105 const [ output ] = result
106106 t . not ( output . patch , patch )
@@ -114,11 +114,11 @@ test('subscribe output of applyPatch must return same length that listeners', fu
114114 const store = createStore ( { prop : false } )
115115 const patch = { prop : true , newprop : true }
116116 store . subscribe (
117- ( ) => { } ,
117+ ( ) => { } ,
118118 ( ) => false
119119 )
120120 store . subscribe (
121- ( ) => { } ,
121+ ( ) => { } ,
122122 ( ) => true
123123 )
124124 const output = store . applyPatch ( patch )
@@ -133,11 +133,11 @@ test('filtered patches by createPatchAndUnpatchFromMutations must be the same as
133133 const store = createStore ( { params : { a : 1 , b : 2 } } )
134134 const patch = { params : TYPE . Replace ( { c : 3 } ) }
135135 store . subscribe (
136- ( ) => { } ,
136+ ( ) => { } ,
137137 ( ) => false
138138 )
139139 store . subscribe (
140- ( ) => { } ,
140+ ( ) => { } ,
141141 ( ) => true
142142 )
143143 const output = store . applyPatch ( patch )
0 commit comments