@@ -7,10 +7,10 @@ import {
77 QueryMsg ,
88} from '@cosmwasm/ts-codegen-types' ;
99import { readFileSync } from 'fs' ;
10- import { globSync as glob } from 'glob' ;
1110import { join } from 'path' ;
1211
1312import { RenderContext } from '../src/context' ;
13+ import { crossGlob , toPosixPath } from '../src/utils' ;
1414
1515export const expectCode = ( ast : any ) : void => {
1616 expect ( generate ( ast ) . code ) . toMatchSnapshot ( ) ;
@@ -50,11 +50,11 @@ const globCache: Record<string, GlobContractLegacy[] | GlobContract[]> = {};
5050export const globIdlBasedContracts = ( p : string ) : GlobContract [ ] => {
5151 if ( globCache [ p ] ) return globCache [ p ] as GlobContract [ ] ;
5252 // @ts -ignore
53- const contracts : GlobContract [ ] = glob ( join ( fixtureDir , p , '/*.json' ) )
53+ const contracts : GlobContract [ ] = crossGlob ( join ( fixtureDir , p , '/*.json' ) )
5454 . sort ( )
5555 . map ( ( file ) => {
5656 return {
57- name : file . split ( join ( '__fixtures__' , p ) ) [ 1 ] ,
57+ name : file . split ( toPosixPath ( join ( '__fixtures__' , p ) ) ) [ 1 ] ,
5858 content : JSON . parse ( readFileSync ( file , 'utf-8' ) ) ,
5959 } ;
6060 } ) ;
@@ -65,11 +65,11 @@ export const globIdlBasedContracts = (p: string): GlobContract[] => {
6565export const globLegacyContracts = ( p : string ) : GlobContractLegacy [ ] => {
6666 if ( globCache [ p ] ) return globCache [ p ] as GlobContractLegacy [ ] ;
6767 // @ts -ignore
68- const contracts : GlobContractLegacy [ ] = glob ( join ( fixtureDir , p , '/*.json' ) )
68+ const contracts : GlobContractLegacy [ ] = crossGlob ( join ( fixtureDir , p , '/*.json' ) )
6969 . sort ( )
7070 . map ( ( file ) => {
7171 return {
72- name : file . split ( join ( '__fixtures__' , p ) ) [ 1 ] ,
72+ name : file . split ( toPosixPath ( join ( '__fixtures__' , p ) ) ) [ 1 ] ,
7373 content : JSON . parse ( readFileSync ( file , 'utf-8' ) ) ,
7474 } ;
7575 } ) ;
0 commit comments