@@ -2,6 +2,7 @@ import { describe, it, expect, vi, beforeEach } from "vitest";
22import * as pkg from "glob" ;
33const { glob } = pkg ;
44import findLocaleFiles from "./find-locale-paths" ;
5+ import { normalizePaths } from "./test-helpers" ;
56
67vi . mock ( "glob" , ( ) => ( {
78 glob : {
@@ -29,7 +30,7 @@ describe("findLocaleFiles", () => {
2930
3031 const result = findLocaleFiles ( "json" ) ;
3132
32- expect ( result ) . toEqual ( {
33+ expect ( normalizePaths ( result ) ) . toEqual ( {
3334 patterns : [ "src/i18n/[locale].json" , "src/translations/[locale].json" ] ,
3435 defaultPatterns : [ "i18n/[locale].json" ] ,
3536 } ) ;
@@ -44,7 +45,7 @@ describe("findLocaleFiles", () => {
4445
4546 const result = findLocaleFiles ( "yaml" ) ;
4647
47- expect ( result ) . toEqual ( {
48+ expect ( normalizePaths ( result ) ) . toEqual ( {
4849 patterns : [ "locales/[locale].yml" , "translations/[locale].yml" ] ,
4950 defaultPatterns : [ "i18n/[locale].yml" ] ,
5051 } ) ;
@@ -59,7 +60,7 @@ describe("findLocaleFiles", () => {
5960
6061 const result = findLocaleFiles ( "flutter" ) ;
6162
62- expect ( result ) . toEqual ( {
63+ expect ( normalizePaths ( result ) ) . toEqual ( {
6364 patterns : [ "lib/l10n/[locale].arb" , "lib/translations/[locale].arb" ] ,
6465 defaultPatterns : [ "i18n/[locale].arb" ] ,
6566 } ) ;
@@ -88,7 +89,7 @@ describe("findLocaleFiles", () => {
8889
8990 const result = findLocaleFiles ( "json" ) ;
9091
91- expect ( result ) . toEqual ( {
92+ expect ( normalizePaths ( result ) ) . toEqual ( {
9293 patterns : [
9394 "src/locales/[locale]/messages.json" ,
9495 "src/i18n/[locale]/strings.json" ,
@@ -111,7 +112,7 @@ describe("findLocaleFiles", () => {
111112
112113 const result = findLocaleFiles ( "json" ) ;
113114
114- expect ( result ) . toEqual ( {
115+ expect ( normalizePaths ( result ) ) . toEqual ( {
115116 patterns : [ ] ,
116117 defaultPatterns : [ "i18n/[locale].json" ] ,
117118 } ) ;
@@ -127,7 +128,7 @@ describe("findLocaleFiles", () => {
127128
128129 const result = findLocaleFiles ( "xcode-xcstrings" ) ;
129130
130- expect ( result ) . toEqual ( {
131+ expect ( normalizePaths ( result ) ) . toEqual ( {
131132 patterns : [
132133 "ios/MyApp/Localizable.xcstrings" ,
133134 "ios/MyApp/Onboarding/Localizable.xcstrings" ,
@@ -142,7 +143,7 @@ describe("findLocaleFiles", () => {
142143
143144 const result = findLocaleFiles ( "xcode-xcstrings" ) ;
144145
145- expect ( result ) . toEqual ( {
146+ expect ( normalizePaths ( result ) ) . toEqual ( {
146147 patterns : [ ] ,
147148 defaultPatterns : [ "Localizable.xcstrings" ] ,
148149 } ) ;
0 commit comments