1- import React from "react" ;
1+ import { describe , it , expect } from 'vitest' ;
22import en from "../../locale/en" ;
33import nl from "../../locale/nl" ;
44
@@ -10,22 +10,23 @@ expect.extend({
1010 } ;
1111 } ,
1212} ) ;
13-
14- test ( "All translations exists in all bundles" , ( ) => {
15- const contains = ( translation , translationToVerify , keyCollection , parents ) => {
16- Object . keys ( translation ) . forEach ( key => {
17- expect ( translationToVerify ) . toContainKey ( key ) ;
18- const value = translation [ key ] ;
19- keyCollection . push ( parents + key ) ;
20- if ( typeof value === "object" ) {
21- contains ( value , translationToVerify [ key ] , keyCollection , parents + key + "." )
22- }
23- } ) ;
24- } ;
25- const keyCollectionEN = [ ] ;
26- contains ( en , nl , keyCollectionEN , '' ) ;
27- const keyCollectionNL = [ ] ;
28- contains ( nl , en , keyCollectionNL , '' ) ;
29- const positionalMismatches = keyCollectionEN . filter ( ( item , index ) => keyCollectionNL [ index ] !== item ) ;
30- expect ( positionalMismatches ) . toEqual ( [ ] )
13+ describe ( 'En' , ( ) => {
14+ it ( "All translations exists in all bundles" , ( ) => {
15+ const contains = ( translation , translationToVerify , keyCollection , parents ) => {
16+ Object . keys ( translation ) . forEach ( key => {
17+ expect ( translationToVerify ) . toContainKey ( key ) ;
18+ const value = translation [ key ] ;
19+ keyCollection . push ( parents + key ) ;
20+ if ( typeof value === "object" ) {
21+ contains ( value , translationToVerify [ key ] , keyCollection , parents + key + "." )
22+ }
23+ } ) ;
24+ } ;
25+ const keyCollectionEN = [ ] ;
26+ contains ( en , nl , keyCollectionEN , '' ) ;
27+ const keyCollectionNL = [ ] ;
28+ contains ( nl , en , keyCollectionNL , '' ) ;
29+ const positionalMismatches = keyCollectionEN . filter ( ( item , index ) => keyCollectionNL [ index ] !== item ) ;
30+ expect ( positionalMismatches ) . toEqual ( [ ] )
31+ } ) ;
3132} ) ;
0 commit comments