@lingual/i18n-check 0.8.2 → 0.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,38 +7,38 @@ const child_process_1 = require("child_process");
7
7
  const errorReporters_1 = require("../errorReporters");
8
8
  const path_1 = __importDefault(require("path"));
9
9
  function tr(file) {
10
- return path_1.default.join("translations", file);
10
+ return path_1.default.join('translations', file);
11
11
  }
12
12
  function multiFiles(file) {
13
- return path_1.default.join("translations/multipleFilesFolderExample", file);
13
+ return path_1.default.join('translations/multipleFilesFolderExample', file);
14
14
  }
15
15
  function multiFolders(file) {
16
- return path_1.default.join("translations/multipleFoldersExample", file);
16
+ return path_1.default.join('translations/multipleFoldersExample', file);
17
17
  }
18
18
  function codeEx(file) {
19
- return path_1.default.join("translations/codeExamples", file);
19
+ return path_1.default.join('translations/codeExamples', file);
20
20
  }
21
21
  function ymlMultiFolders(file) {
22
- return path_1.default.join("translations/yaml/multipleFoldersExample", file);
22
+ return path_1.default.join('translations/yaml/multipleFoldersExample', file);
23
23
  }
24
24
  function execAsync(cmd) {
25
25
  return new Promise((resolve) => {
26
- (0, child_process_1.exec)(cmd, (error, stdout, stderr) => {
26
+ (0, child_process_1.exec)(cmd, (error, stdout) => {
27
27
  resolve(stdout);
28
28
  });
29
29
  });
30
30
  }
31
- describe("CLI", () => {
32
- describe("JSON", () => {
33
- it("should return the missing keys for single folder translations", async () => {
34
- const stdout = await execAsync("node dist/bin/index.js -s en-US -l translations/flattenExamples");
35
- const result = stdout.split("Done")[0];
36
- const filePath = tr("flattenExamples/de-de.json");
31
+ describe('CLI', () => {
32
+ describe('JSON', () => {
33
+ it('should return the missing keys for single folder translations', async () => {
34
+ const stdout = await execAsync('node dist/bin/index.js -s en-US -l translations/flattenExamples');
35
+ const result = stdout.split('Done')[0];
36
+ const filePath = tr('flattenExamples/de-de.json');
37
37
  const table = (0, errorReporters_1.formatTable)([
38
- [["file", "key"]],
38
+ [['file', 'key']],
39
39
  [
40
- [filePath, "other.nested.three"],
41
- [filePath, "other.nested.deep.more.final"],
40
+ [filePath, 'other.nested.three'],
41
+ [filePath, 'other.nested.deep.more.final'],
42
42
  ],
43
43
  ]);
44
44
  expect(result).toEqual(`i18n translations checker
@@ -51,20 +51,20 @@ No invalid translations found!
51
51
 
52
52
  `);
53
53
  });
54
- it("should return the missing/invalid keys for folder per locale with single file", async () => {
55
- const stdout = await execAsync("node dist/bin/index.js -l translations/folderExample/ -s en-US");
56
- const result = stdout.split("Done")[0];
54
+ it('should return the missing/invalid keys for folder per locale with single file', async () => {
55
+ const stdout = await execAsync('node dist/bin/index.js -l translations/folderExample/ -s en-US');
56
+ const result = stdout.split('Done')[0];
57
57
  const missingKeysTable = (0, errorReporters_1.formatTable)([
58
- [["file", "key"]],
59
- [[tr("folderExample/de-DE/index.json"), "message.text-format"]],
58
+ [['file', 'key']],
59
+ [[tr('folderExample/de-DE/index.json'), 'message.text-format']],
60
60
  ]);
61
61
  const invalidKeysTable = (0, errorReporters_1.formatTable)([
62
- [["info", "result"]],
62
+ [['info', 'result']],
63
63
  [
64
- ["file", tr("folderExample/de-DE/index.json")],
65
- ["key", "message.select"],
64
+ ['file', tr('folderExample/de-DE/index.json')],
65
+ ['key', 'message.select'],
66
66
  [
67
- "msg",
67
+ 'msg',
68
68
  'Expected element of type "select" but received "argument", Unexpected date element, Unexpected date element...',
69
69
  ],
70
70
  ],
@@ -80,32 +80,32 @@ ${invalidKeysTable}
80
80
 
81
81
  `);
82
82
  });
83
- it("should return the missing/invalid keys for folder per locale with multiple files", async () => {
84
- const stdout = await execAsync("node dist/bin/index.js -l translations/multipleFilesFolderExample/ -s en-US");
83
+ it('should return the missing/invalid keys for folder per locale with multiple files', async () => {
84
+ const stdout = await execAsync('node dist/bin/index.js -l translations/multipleFilesFolderExample/ -s en-US');
85
85
  const missingKeysTable = (0, errorReporters_1.formatTable)([
86
- [["file", "key"]],
86
+ [['file', 'key']],
87
87
  [
88
- [multiFiles("de-DE/one.json"), "message.text-format"],
89
- [multiFiles("de-DE/two.json"), "test.drive.four"],
88
+ [multiFiles('de-DE/one.json'), 'message.text-format'],
89
+ [multiFiles('de-DE/two.json'), 'test.drive.four'],
90
90
  ],
91
91
  ]);
92
92
  const invalidKeysTable = (0, errorReporters_1.formatTable)([
93
- [["info", "result"]],
93
+ [['info', 'result']],
94
94
  [
95
- ["file", multiFiles("de-DE/one.json")],
96
- ["key", "message.select"],
95
+ ['file', multiFiles('de-DE/one.json')],
96
+ ['key', 'message.select'],
97
97
  [
98
- "msg",
98
+ 'msg',
99
99
  'Expected element of type "select" but received "argument", Unexpected date element, Unexpected date element...',
100
100
  ],
101
101
  ],
102
102
  [
103
- ["file", multiFiles("de-DE/three.json")],
104
- ["key", "multipleVariables"],
105
- ["msg", 'Expected argument to contain "user" but received "name" '],
103
+ ['file', multiFiles('de-DE/three.json')],
104
+ ['key', 'multipleVariables'],
105
+ ['msg', 'Expected argument to contain "user" but received "name" '],
106
106
  ],
107
107
  ]);
108
- const result = stdout.split("Done")[0];
108
+ const result = stdout.split('Done')[0];
109
109
  expect(result).toEqual(`i18n translations checker
110
110
  Source: en-US
111
111
 
@@ -117,241 +117,241 @@ ${invalidKeysTable}
117
117
 
118
118
  `);
119
119
  });
120
- it("should return the missing/invalid keys for folder containing multiple locale folders", async () => {
121
- const stdout = await execAsync("node dist/bin/index.js -l translations/multipleFoldersExample -s en-US");
122
- const result = stdout.split("Done")[0];
120
+ it('should return the missing/invalid keys for folder containing multiple locale folders', async () => {
121
+ const stdout = await execAsync('node dist/bin/index.js -l translations/multipleFoldersExample -s en-US');
122
+ const result = stdout.split('Done')[0];
123
123
  expect(result).toEqual(`i18n translations checker
124
124
  Source: en-US
125
125
 
126
126
  Found missing keys!
127
127
  ${(0, errorReporters_1.formatTable)([
128
- [["file", "key"]],
128
+ [['file', 'key']],
129
129
  [
130
- [multiFolders("spaceOne/locales/de-DE/one.json"), "message.text-format"],
131
- [multiFolders("spaceOne/locales/de-DE/two.json"), "test.drive.four"],
132
- [multiFolders("spaceTwo/locales/de-DE/one.json"), "message.plural"],
133
- [multiFolders("spaceTwo/locales/de-DE/two.json"), "test.drive.two"],
130
+ [multiFolders('spaceOne/locales/de-DE/one.json'), 'message.text-format'],
131
+ [multiFolders('spaceOne/locales/de-DE/two.json'), 'test.drive.four'],
132
+ [multiFolders('spaceTwo/locales/de-DE/one.json'), 'message.plural'],
133
+ [multiFolders('spaceTwo/locales/de-DE/two.json'), 'test.drive.two'],
134
134
  ],
135
135
  ])}
136
136
 
137
137
  Found invalid keys!
138
138
  ${(0, errorReporters_1.formatTable)([
139
- [["info", "result"]],
139
+ [['info', 'result']],
140
140
  [
141
- ["file", multiFolders("spaceOne/locales/de-DE/one.json")],
142
- ["key", "message.select"],
141
+ ['file', multiFolders('spaceOne/locales/de-DE/one.json')],
142
+ ['key', 'message.select'],
143
143
  [
144
- "msg",
144
+ 'msg',
145
145
  'Expected element of type "select" but received "argument", Unexpected date element, Unexpected date element...',
146
146
  ],
147
147
  ],
148
148
  [
149
- ["file", multiFolders("spaceOne/locales/de-DE/three.json")],
150
- ["key", "multipleVariables"],
151
- ["msg", 'Expected argument to contain "user" but received "name"'],
149
+ ['file', multiFolders('spaceOne/locales/de-DE/three.json')],
150
+ ['key', 'multipleVariables'],
151
+ ['msg', 'Expected argument to contain "user" but received "name"'],
152
152
  ],
153
153
  [
154
- ["file", multiFolders("spaceTwo/locales/de-DE/one.json")],
155
- ["key", "message.text-format"],
154
+ ['file', multiFolders('spaceTwo/locales/de-DE/one.json')],
155
+ ['key', 'message.text-format'],
156
156
  [
157
- "msg",
157
+ 'msg',
158
158
  'Expected element of type "tag" but received "number", Unexpected tag element',
159
159
  ],
160
160
  ],
161
161
  [
162
- ["file", multiFolders("spaceTwo/locales/de-DE/three.json")],
163
- ["key", "numberFormat"],
164
- ["msg", "Missing element number"],
162
+ ['file', multiFolders('spaceTwo/locales/de-DE/three.json')],
163
+ ['key', 'numberFormat'],
164
+ ['msg', 'Missing element number'],
165
165
  ],
166
166
  ])}
167
167
 
168
168
  `);
169
169
  });
170
- it("should return the missing/invalid keys for multiple locale folders", async () => {
171
- const stdout = await execAsync("node dist/bin/index.js -l translations/multipleFoldersExample/spaceOne translations/multipleFoldersExample/spaceTwo -s en-US");
172
- const result = stdout.split("Done")[0];
170
+ it('should return the missing/invalid keys for multiple locale folders', async () => {
171
+ const stdout = await execAsync('node dist/bin/index.js -l translations/multipleFoldersExample/spaceOne translations/multipleFoldersExample/spaceTwo -s en-US');
172
+ const result = stdout.split('Done')[0];
173
173
  expect(result).toEqual(`i18n translations checker
174
174
  Source: en-US
175
175
 
176
176
  Found missing keys!
177
177
  ${(0, errorReporters_1.formatTable)([
178
- [["file", "key"]],
178
+ [['file', 'key']],
179
179
  [
180
- [multiFolders("spaceOne/locales/de-DE/one.json"), "message.text-format"],
181
- [multiFolders("spaceOne/locales/de-DE/two.json"), "test.drive.four"],
182
- [multiFolders("spaceTwo/locales/de-DE/one.json"), "message.plural"],
183
- [multiFolders("spaceTwo/locales/de-DE/two.json"), "test.drive.two"],
180
+ [multiFolders('spaceOne/locales/de-DE/one.json'), 'message.text-format'],
181
+ [multiFolders('spaceOne/locales/de-DE/two.json'), 'test.drive.four'],
182
+ [multiFolders('spaceTwo/locales/de-DE/one.json'), 'message.plural'],
183
+ [multiFolders('spaceTwo/locales/de-DE/two.json'), 'test.drive.two'],
184
184
  ],
185
185
  ])}
186
186
 
187
187
  Found invalid keys!
188
188
  ${(0, errorReporters_1.formatTable)([
189
- [["info", "result"]],
189
+ [['info', 'result']],
190
190
  [
191
- ["file", multiFolders("spaceOne/locales/de-DE/one.json")],
192
- ["key", "message.select"],
191
+ ['file', multiFolders('spaceOne/locales/de-DE/one.json')],
192
+ ['key', 'message.select'],
193
193
  [
194
- "msg",
194
+ 'msg',
195
195
  'Expected element of type "select" but received "argument", Unexpected date element, Unexpected date element...',
196
196
  ],
197
197
  ],
198
198
  [
199
- ["file", multiFolders("spaceOne/locales/de-DE/three.json")],
200
- ["key", "multipleVariables"],
201
- ["msg", 'Expected argument to contain "user" but received "name"'],
199
+ ['file', multiFolders('spaceOne/locales/de-DE/three.json')],
200
+ ['key', 'multipleVariables'],
201
+ ['msg', 'Expected argument to contain "user" but received "name"'],
202
202
  ],
203
203
  [
204
- ["file", multiFolders("spaceTwo/locales/de-DE/one.json")],
205
- ["key", "message.text-format"],
204
+ ['file', multiFolders('spaceTwo/locales/de-DE/one.json')],
205
+ ['key', 'message.text-format'],
206
206
  [
207
- "msg",
207
+ 'msg',
208
208
  'Expected element of type "tag" but received "number", Unexpected tag element',
209
209
  ],
210
210
  ],
211
211
  [
212
- ["file", multiFolders("spaceTwo/locales/de-DE/three.json")],
213
- ["key", "numberFormat"],
214
- ["msg", "Missing element number"],
212
+ ['file', multiFolders('spaceTwo/locales/de-DE/three.json')],
213
+ ['key', 'numberFormat'],
214
+ ['msg', 'Missing element number'],
215
215
  ],
216
216
  ])}
217
217
 
218
218
  `);
219
219
  });
220
- it("should return the missing/invalid keys for all files in the provided locale folders", async () => {
221
- const stdout = await execAsync("node dist/bin/index.js --source en-US --locales translations/flattenExamples translations/messageExamples");
222
- const result = stdout.split("Done")[0];
220
+ it('should return the missing/invalid keys for all files in the provided locale folders', async () => {
221
+ const stdout = await execAsync('node dist/bin/index.js --source en-US --locales translations/flattenExamples translations/messageExamples');
222
+ const result = stdout.split('Done')[0];
223
223
  expect(result).toEqual(`i18n translations checker
224
224
  Source: en-US
225
225
 
226
226
  Found missing keys!
227
227
  ${(0, errorReporters_1.formatTable)([
228
- [["file", "key"]],
228
+ [['file', 'key']],
229
229
  [
230
- [tr("flattenExamples/de-de.json"), "other.nested.three"],
231
- [tr("flattenExamples/de-de.json"), "other.nested.deep.more.final"],
232
- [tr("messageExamples/de-de.json"), "richText"],
233
- [tr("messageExamples/de-de.json"), "yo"],
234
- [tr("messageExamples/de-de.json"), "nesting1"],
235
- [tr("messageExamples/de-de.json"), "nesting2"],
236
- [tr("messageExamples/de-de.json"), "nesting3"],
237
- [tr("messageExamples/de-de.json"), "key1"],
230
+ [tr('flattenExamples/de-de.json'), 'other.nested.three'],
231
+ [tr('flattenExamples/de-de.json'), 'other.nested.deep.more.final'],
232
+ [tr('messageExamples/de-de.json'), 'richText'],
233
+ [tr('messageExamples/de-de.json'), 'yo'],
234
+ [tr('messageExamples/de-de.json'), 'nesting1'],
235
+ [tr('messageExamples/de-de.json'), 'nesting2'],
236
+ [tr('messageExamples/de-de.json'), 'nesting3'],
237
+ [tr('messageExamples/de-de.json'), 'key1'],
238
238
  ],
239
239
  ])}
240
240
 
241
241
  Found invalid keys!
242
242
  ${(0, errorReporters_1.formatTable)([
243
- [["info", "result"]],
243
+ [['info', 'result']],
244
244
  [
245
- ["file", tr("messageExamples/de-de.json")],
246
- ["key", "multipleVariables"],
247
- ["msg", "Unexpected date element"],
245
+ ['file', tr('messageExamples/de-de.json')],
246
+ ['key', 'multipleVariables'],
247
+ ['msg', 'Unexpected date element'],
248
248
  ],
249
249
  ])}
250
250
 
251
251
  `);
252
252
  });
253
- it("should return the missing/invalid keys for all files with source matching folder and source matching file", async () => {
254
- const stdout = await execAsync("node dist/bin/index.js -l translations/multipleFilesFolderExample translations/flattenExamples -s en-US");
255
- const result = stdout.split("Done")[0];
253
+ it('should return the missing/invalid keys for all files with source matching folder and source matching file', async () => {
254
+ const stdout = await execAsync('node dist/bin/index.js -l translations/multipleFilesFolderExample translations/flattenExamples -s en-US');
255
+ const result = stdout.split('Done')[0];
256
256
  expect(result).toEqual(`i18n translations checker
257
257
  Source: en-US
258
258
 
259
259
  Found missing keys!
260
260
  ${(0, errorReporters_1.formatTable)([
261
- [["file", "key"]],
261
+ [['file', 'key']],
262
262
  [
263
- [tr("flattenExamples/de-de.json"), "other.nested.three"],
264
- [tr("flattenExamples/de-de.json"), "other.nested.deep.more.final"],
265
- [multiFiles("de-DE/one.json"), "message.text-format"],
266
- [multiFiles("de-DE/two.json"), "test.drive.four"],
263
+ [tr('flattenExamples/de-de.json'), 'other.nested.three'],
264
+ [tr('flattenExamples/de-de.json'), 'other.nested.deep.more.final'],
265
+ [multiFiles('de-DE/one.json'), 'message.text-format'],
266
+ [multiFiles('de-DE/two.json'), 'test.drive.four'],
267
267
  ],
268
268
  ])}
269
269
 
270
270
  Found invalid keys!
271
271
  ${(0, errorReporters_1.formatTable)([
272
- [["info", "result"]],
272
+ [['info', 'result']],
273
273
  [
274
- ["file", multiFiles("de-DE/one.json")],
275
- ["key", "message.select"],
274
+ ['file', multiFiles('de-DE/one.json')],
275
+ ['key', 'message.select'],
276
276
  [
277
- "msg",
277
+ 'msg',
278
278
  'Expected element of type "select" but received "argument", Unexpected date element, Unexpected date element...',
279
279
  ],
280
280
  ],
281
281
  [
282
- ["file", multiFiles("de-DE/three.json")],
283
- ["key", "multipleVariables"],
284
- ["msg", 'Expected argument to contain "user" but received "name"'],
282
+ ['file', multiFiles('de-DE/three.json')],
283
+ ['key', 'multipleVariables'],
284
+ ['msg', 'Expected argument to contain "user" but received "name"'],
285
285
  ],
286
286
  ])}
287
287
 
288
288
  `);
289
289
  });
290
- it("should ignore the excluded file", async () => {
291
- const stdout = await execAsync("node dist/bin/index.js --source en-US --locales translations/flattenExamples translations/messageExamples --exclude translations/flattenExamples/de-de.json");
292
- const result = stdout.split("Done")[0];
290
+ it('should ignore the excluded file', async () => {
291
+ const stdout = await execAsync('node dist/bin/index.js --source en-US --locales translations/flattenExamples translations/messageExamples --exclude translations/flattenExamples/de-de.json');
292
+ const result = stdout.split('Done')[0];
293
293
  expect(result).toEqual(`i18n translations checker
294
294
  Source: en-US
295
295
 
296
296
  Found missing keys!
297
297
  ${(0, errorReporters_1.formatTable)([
298
- [["file", "key"]],
298
+ [['file', 'key']],
299
299
  [
300
- [tr("messageExamples/de-de.json"), "richText"],
301
- [tr("messageExamples/de-de.json"), "yo"],
302
- [tr("messageExamples/de-de.json"), "nesting1"],
303
- [tr("messageExamples/de-de.json"), "nesting2"],
304
- [tr("messageExamples/de-de.json"), "nesting3"],
305
- [tr("messageExamples/de-de.json"), "key1"],
300
+ [tr('messageExamples/de-de.json'), 'richText'],
301
+ [tr('messageExamples/de-de.json'), 'yo'],
302
+ [tr('messageExamples/de-de.json'), 'nesting1'],
303
+ [tr('messageExamples/de-de.json'), 'nesting2'],
304
+ [tr('messageExamples/de-de.json'), 'nesting3'],
305
+ [tr('messageExamples/de-de.json'), 'key1'],
306
306
  ],
307
307
  ])}
308
308
 
309
309
  Found invalid keys!
310
310
  ${(0, errorReporters_1.formatTable)([
311
- [["info", "result"]],
311
+ [['info', 'result']],
312
312
  [
313
- ["file", tr("messageExamples/de-de.json")],
314
- ["key", "multipleVariables"],
315
- ["msg", "Unexpected date element"],
313
+ ['file', tr('messageExamples/de-de.json')],
314
+ ['key', 'multipleVariables'],
315
+ ['msg', 'Unexpected date element'],
316
316
  ],
317
317
  ])}
318
318
 
319
319
  `);
320
320
  });
321
- it("should ignore the excluded folder", async () => {
322
- const stdout = await execAsync("node dist/bin/index.js --source en-US --locales translations/flattenExamples translations/messageExamples --exclude translations/flattenExamples/*");
323
- const result = stdout.split("Done")[0];
321
+ it('should ignore the excluded folder', async () => {
322
+ const stdout = await execAsync('node dist/bin/index.js --source en-US --locales translations/flattenExamples translations/messageExamples --exclude translations/flattenExamples/*');
323
+ const result = stdout.split('Done')[0];
324
324
  expect(result).toEqual(`i18n translations checker
325
325
  Source: en-US
326
326
 
327
327
  Found missing keys!
328
328
  ${(0, errorReporters_1.formatTable)([
329
- [["file", "key"]],
329
+ [['file', 'key']],
330
330
  [
331
- [tr("messageExamples/de-de.json"), "richText"],
332
- [tr("messageExamples/de-de.json"), "yo"],
333
- [tr("messageExamples/de-de.json"), "nesting1"],
334
- [tr("messageExamples/de-de.json"), "nesting2"],
335
- [tr("messageExamples/de-de.json"), "nesting3"],
336
- [tr("messageExamples/de-de.json"), "key1"],
331
+ [tr('messageExamples/de-de.json'), 'richText'],
332
+ [tr('messageExamples/de-de.json'), 'yo'],
333
+ [tr('messageExamples/de-de.json'), 'nesting1'],
334
+ [tr('messageExamples/de-de.json'), 'nesting2'],
335
+ [tr('messageExamples/de-de.json'), 'nesting3'],
336
+ [tr('messageExamples/de-de.json'), 'key1'],
337
337
  ],
338
338
  ])}
339
339
 
340
340
  Found invalid keys!
341
341
  ${(0, errorReporters_1.formatTable)([
342
- [["info", "result"]],
342
+ [['info', 'result']],
343
343
  [
344
- ["file", tr("messageExamples/de-de.json")],
345
- ["key", "multipleVariables"],
346
- ["msg", "Unexpected date element"],
344
+ ['file', tr('messageExamples/de-de.json')],
345
+ ['key', 'multipleVariables'],
346
+ ['msg', 'Unexpected date element'],
347
347
  ],
348
348
  ])}
349
349
 
350
350
  `);
351
351
  });
352
- it("should ignore the excluded multiple files", async () => {
353
- const stdout = await execAsync("node dist/bin/index.js --source en-US --locales translations/flattenExamples translations/messageExamples --exclude translations/flattenExamples/de-de.json translations/messageExamples/de-de.json");
354
- const result = stdout.split("Done")[0];
352
+ it('should ignore the excluded multiple files', async () => {
353
+ const stdout = await execAsync('node dist/bin/index.js --source en-US --locales translations/flattenExamples translations/messageExamples --exclude translations/flattenExamples/de-de.json translations/messageExamples/de-de.json');
354
+ const result = stdout.split('Done')[0];
355
355
  expect(result).toEqual(`i18n translations checker
356
356
  Source: en-US
357
357
 
@@ -361,9 +361,9 @@ No invalid translations found!
361
361
 
362
362
  `);
363
363
  });
364
- it("should find unused and undefined keys for react-i18next applications", async () => {
365
- const stdout = await execAsync("node dist/bin/index.js --source en --locales translations/codeExamples/reacti18next/locales -f i18next -u translations/codeExamples/reacti18next/src --parser-component-functions WrappedTransComponent");
366
- const result = stdout.split("Done")[0];
364
+ it('should find unused and undefined keys for react-i18next applications', async () => {
365
+ const stdout = await execAsync('node dist/bin/index.js --source en --locales translations/codeExamples/reacti18next/locales -f i18next -u translations/codeExamples/reacti18next/src --parser-component-functions WrappedTransComponent');
366
+ const result = stdout.split('Done')[0];
367
367
  expect(result).toEqual(`i18n translations checker
368
368
  Source: en
369
369
  Selected format is: i18next
@@ -374,24 +374,24 @@ No invalid translations found!
374
374
 
375
375
  Found unused keys!
376
376
  ${(0, errorReporters_1.formatTable)([
377
- [["file", "key"]],
377
+ [['file', 'key']],
378
378
  [
379
- [codeEx("reacti18next/locales/en/translation.json"), "format.ebook"],
380
- [codeEx("reacti18next/locales/en/translation.json"), "nonExistentKey"],
379
+ [codeEx('reacti18next/locales/en/translation.json'), 'format.ebook'],
380
+ [codeEx('reacti18next/locales/en/translation.json'), 'nonExistentKey'],
381
381
  ],
382
382
  ])}
383
383
 
384
384
  Found undefined keys!
385
385
  ${(0, errorReporters_1.formatTable)([
386
- [["file", "key"]],
387
- [[codeEx("reacti18next/src/App.tsx"), "some.key.that.is.not.defined"]],
386
+ [['file', 'key']],
387
+ [[codeEx('reacti18next/src/App.tsx'), 'some.key.that.is.not.defined']],
388
388
  ])}
389
389
 
390
390
  `);
391
391
  });
392
- it("should find unused and undefined keys for react-i18next applications with multiple source folders", async () => {
393
- const stdout = await execAsync("node dist/bin/index.js --source en --locales translations/codeExamples/reacti18next/locales -f i18next -u translations/codeExamples/reacti18next/src translations/codeExamples/reacti18next/secondSrcFolder --parser-component-functions WrappedTransComponent");
394
- const result = stdout.split("Done")[0];
392
+ it('should find unused and undefined keys for react-i18next applications with multiple source folders', async () => {
393
+ const stdout = await execAsync('node dist/bin/index.js --source en --locales translations/codeExamples/reacti18next/locales -f i18next -u translations/codeExamples/reacti18next/src translations/codeExamples/reacti18next/secondSrcFolder --parser-component-functions WrappedTransComponent');
394
+ const result = stdout.split('Done')[0];
395
395
  expect(result).toEqual(`i18n translations checker
396
396
  Source: en
397
397
  Selected format is: i18next
@@ -402,30 +402,30 @@ No invalid translations found!
402
402
 
403
403
  Found unused keys!
404
404
  ${(0, errorReporters_1.formatTable)([
405
- [["file", "key"]],
405
+ [['file', 'key']],
406
406
  [
407
- [codeEx("reacti18next/locales/en/translation.json"), "format.ebook"],
408
- [codeEx("reacti18next/locales/en/translation.json"), "nonExistentKey"],
407
+ [codeEx('reacti18next/locales/en/translation.json'), 'format.ebook'],
408
+ [codeEx('reacti18next/locales/en/translation.json'), 'nonExistentKey'],
409
409
  ],
410
410
  ])}
411
411
 
412
412
  Found undefined keys!
413
413
  ${(0, errorReporters_1.formatTable)([
414
- [["file", "key"]],
414
+ [['file', 'key']],
415
415
  [
416
- [codeEx("reacti18next/src/App.tsx"), "some.key.that.is.not.defined"],
416
+ [codeEx('reacti18next/src/App.tsx'), 'some.key.that.is.not.defined'],
417
417
  [
418
- codeEx("reacti18next/secondSrcFolder/Main.tsx"),
419
- "another.key.that.is.not.defined",
418
+ codeEx('reacti18next/secondSrcFolder/Main.tsx'),
419
+ 'another.key.that.is.not.defined',
420
420
  ],
421
421
  ],
422
422
  ])}
423
423
 
424
424
  `);
425
425
  });
426
- it("should find unused and undefined keys for react-intl applications", async () => {
427
- const stdout = await execAsync("node dist/bin/index.js --source en-US --locales translations/codeExamples/react-intl/locales -f react-intl -u translations/codeExamples/react-intl/src");
428
- const result = stdout.split("Done")[0];
426
+ it('should find unused and undefined keys for react-intl applications', async () => {
427
+ const stdout = await execAsync('node dist/bin/index.js --source en-US --locales translations/codeExamples/react-intl/locales -f react-intl -u translations/codeExamples/react-intl/src');
428
+ const result = stdout.split('Done')[0];
429
429
  expect(result).toEqual(`i18n translations checker
430
430
  Source: en-US
431
431
  Selected format is: react-intl
@@ -436,24 +436,24 @@ No invalid translations found!
436
436
 
437
437
  Found unused keys!
438
438
  ${(0, errorReporters_1.formatTable)([
439
- [["file", "key"]],
439
+ [['file', 'key']],
440
440
  [
441
- [codeEx("react-intl/locales/en-US/one.json"), "message.number-format"],
442
- [codeEx("react-intl/locales/en-US/three.json"), "multipleVariables"],
441
+ [codeEx('react-intl/locales/en-US/one.json'), 'message.number-format'],
442
+ [codeEx('react-intl/locales/en-US/three.json'), 'multipleVariables'],
443
443
  ],
444
444
  ])}
445
445
 
446
446
  Found undefined keys!
447
447
  ${(0, errorReporters_1.formatTable)([
448
- [["file", "key"]],
449
- [[codeEx("react-intl/src/App.tsx"), "some.key.that.is.not.defined"]],
448
+ [['file', 'key']],
449
+ [[codeEx('react-intl/src/App.tsx'), 'some.key.that.is.not.defined']],
450
450
  ])}
451
451
 
452
452
  `);
453
453
  });
454
- it("should find unused and undefined keys for next-intl applications", async () => {
455
- const stdout = await execAsync("node dist/bin/index.js --source en --locales translations/codeExamples/next-intl/locales/ -f next-intl -u translations/codeExamples/next-intl/src");
456
- const result = stdout.split("Done")[0];
454
+ it('should find unused and undefined keys for next-intl applications', async () => {
455
+ const stdout = await execAsync('node dist/bin/index.js --source en --locales translations/codeExamples/next-intl/locales/ -f next-intl -u translations/codeExamples/next-intl/src');
456
+ const result = stdout.split('Done')[0];
457
457
  expect(result).toEqual(`i18n translations checker
458
458
  Source: en
459
459
  Selected format is: next-intl
@@ -464,47 +464,79 @@ No invalid translations found!
464
464
 
465
465
  Found unused keys!
466
466
  ${(0, errorReporters_1.formatTable)([
467
- [["file", "key"]],
467
+ [['file', 'key']],
468
468
  [
469
- [codeEx("next-intl/locales/en/translation.json"), "message.plural"],
470
- [codeEx("next-intl/locales/en/translation.json"), "notUsedKey"],
469
+ [codeEx('next-intl/locales/en/translation.json'), 'message.plural'],
470
+ [codeEx('next-intl/locales/en/translation.json'), 'notUsedKey'],
471
471
  ],
472
472
  ])}
473
473
 
474
474
  Found undefined keys!
475
475
  ${(0, errorReporters_1.formatTable)([
476
- [["file", "key"]],
476
+ [['file', 'key']],
477
477
  [
478
- [codeEx("next-intl/src/StrictTypesExample.tsx"), "About.unknown"],
479
- [codeEx("next-intl/src/StrictTypesExample.tsx"), "About.unknown"],
480
- [codeEx("next-intl/src/StrictTypesExample.tsx"), "Test.title"],
481
- [codeEx("next-intl/src/StrictTypesExample.tsx"), "Test.title"],
482
- [codeEx("next-intl/src/StrictTypesExample.tsx"), "title"],
483
- [codeEx("next-intl/src/StrictTypesExample.tsx"), "title"],
484
- [codeEx("next-intl/src/StrictTypesExample.tsx"), "unknown"],
485
- [codeEx("next-intl/src/StrictTypesExample.tsx"), "unknown"],
486
- [codeEx("next-intl/src/StrictTypesExample.tsx"), "unknown.unknown"],
487
- [codeEx("next-intl/src/StrictTypesExample.tsx"), "unknown.unknown"],
488
- [codeEx("next-intl/src/Basic.tsx"), "message.select"],
478
+ [codeEx('next-intl/src/StrictTypesExample.tsx'), 'About.unknown'],
479
+ [codeEx('next-intl/src/StrictTypesExample.tsx'), 'About.unknown'],
480
+ [codeEx('next-intl/src/StrictTypesExample.tsx'), 'Test.title'],
481
+ [codeEx('next-intl/src/StrictTypesExample.tsx'), 'Test.title'],
482
+ [codeEx('next-intl/src/StrictTypesExample.tsx'), 'title'],
483
+ [codeEx('next-intl/src/StrictTypesExample.tsx'), 'title'],
484
+ [codeEx('next-intl/src/StrictTypesExample.tsx'), 'unknown'],
485
+ [codeEx('next-intl/src/StrictTypesExample.tsx'), 'unknown'],
486
+ [codeEx('next-intl/src/StrictTypesExample.tsx'), 'unknown.unknown'],
487
+ [codeEx('next-intl/src/StrictTypesExample.tsx'), 'unknown.unknown'],
488
+ [codeEx('next-intl/src/Basic.tsx'), 'message.select'],
489
+ ],
490
+ ])}
491
+
492
+ `);
493
+ });
494
+ it('should skip ignored keys when checking for missing/invalid keys', async () => {
495
+ const stdout = await execAsync('node dist/bin/index.js -l translations/multipleFilesFolderExample translations/flattenExamples -s en-US -i "other.nested.*" test.drive.four');
496
+ const result = stdout.split('Done')[0];
497
+ expect(result).toEqual(`i18n translations checker
498
+ Source: en-US
499
+
500
+ Found missing keys!
501
+ ${(0, errorReporters_1.formatTable)([
502
+ [['file', 'key']],
503
+ [[multiFiles('de-DE/one.json'), 'message.text-format']],
504
+ ])}
505
+
506
+ Found invalid keys!
507
+ ${(0, errorReporters_1.formatTable)([
508
+ [['info', 'result']],
509
+ [
510
+ ['file', multiFiles('de-DE/one.json')],
511
+ ['key', 'message.select'],
512
+ [
513
+ 'msg',
514
+ 'Expected element of type "select" but received "argument", Unexpected date element, Unexpected date element...',
515
+ ],
516
+ ],
517
+ [
518
+ ['file', multiFiles('de-DE/three.json')],
519
+ ['key', 'multipleVariables'],
520
+ ['msg', 'Expected argument to contain "user" but received "name"'],
489
521
  ],
490
522
  ])}
491
523
 
492
524
  `);
493
525
  });
494
526
  });
495
- describe("YAML", () => {
496
- it("should return the missing keys for single folder translations", async () => {
497
- const stdout = await execAsync("node dist/bin/index.js -s en-US -l translations/yaml/flattenExamples");
498
- const result = stdout.split("Done")[0];
527
+ describe('YAML', () => {
528
+ it('should return the missing keys for single folder translations', async () => {
529
+ const stdout = await execAsync('node dist/bin/index.js -s en-US -l translations/yaml/flattenExamples');
530
+ const result = stdout.split('Done')[0];
499
531
  expect(result).toEqual(`i18n translations checker
500
532
  Source: en-US
501
533
 
502
534
  Found missing keys!
503
535
  ${(0, errorReporters_1.formatTable)([
504
- [["file", "key"]],
536
+ [['file', 'key']],
505
537
  [
506
- [tr("yaml/flattenExamples/de-de.yaml"), "other.nested.three"],
507
- [tr("yaml/flattenExamples/de-de.yaml"), "other.nested.deep.more.final"],
538
+ [tr('yaml/flattenExamples/de-de.yaml'), 'other.nested.three'],
539
+ [tr('yaml/flattenExamples/de-de.yaml'), 'other.nested.deep.more.final'],
508
540
  ],
509
541
  ])}
510
542
 
@@ -512,26 +544,26 @@ No invalid translations found!
512
544
 
513
545
  `);
514
546
  });
515
- it("should return the missing/invalid keys for folder per locale with single file", async () => {
516
- const stdout = await execAsync("node dist/bin/index.js -l translations/yaml/folderExample/ -s en-US");
517
- const result = stdout.split("Done")[0];
547
+ it('should return the missing/invalid keys for folder per locale with single file', async () => {
548
+ const stdout = await execAsync('node dist/bin/index.js -l translations/yaml/folderExample/ -s en-US');
549
+ const result = stdout.split('Done')[0];
518
550
  expect(result).toEqual(`i18n translations checker
519
551
  Source: en-US
520
552
 
521
553
  Found missing keys!
522
554
  ${(0, errorReporters_1.formatTable)([
523
- [["file", "key"]],
524
- [[tr("yaml/folderExample/de-DE/index.yaml"), "message.text-format"]],
555
+ [['file', 'key']],
556
+ [[tr('yaml/folderExample/de-DE/index.yaml'), 'message.text-format']],
525
557
  ])}
526
558
 
527
559
  Found invalid keys!
528
560
  ${(0, errorReporters_1.formatTable)([
529
- [["info", "result"]],
561
+ [['info', 'result']],
530
562
  [
531
- ["file", tr("yaml/folderExample/de-DE/index.yaml")],
532
- ["key", "message.select"],
563
+ ['file', tr('yaml/folderExample/de-DE/index.yaml')],
564
+ ['key', 'message.select'],
533
565
  [
534
- "msg",
566
+ 'msg',
535
567
  'Expected element of type "select" but received "argument", Unexpected date element, Unexpected date element...',
536
568
  ],
537
569
  ],
@@ -539,212 +571,212 @@ ${(0, errorReporters_1.formatTable)([
539
571
 
540
572
  `);
541
573
  });
542
- it("should return the missing/invalid keys for folder per locale with multiple files", async () => {
543
- const stdout = await execAsync("node dist/bin/index.js -l translations/yaml/multipleFilesFolderExample/ -s en-US");
544
- const result = stdout.split("Done")[0];
574
+ it('should return the missing/invalid keys for folder per locale with multiple files', async () => {
575
+ const stdout = await execAsync('node dist/bin/index.js -l translations/yaml/multipleFilesFolderExample/ -s en-US');
576
+ const result = stdout.split('Done')[0];
545
577
  expect(result).toEqual(`i18n translations checker
546
578
  Source: en-US
547
579
 
548
580
  Found missing keys!
549
581
  ${(0, errorReporters_1.formatTable)([
550
- [["file", "key"]],
582
+ [['file', 'key']],
551
583
  [
552
584
  [
553
- tr("yaml/multipleFilesFolderExample/de-DE/one.yaml"),
554
- "message.text-format",
585
+ tr('yaml/multipleFilesFolderExample/de-DE/one.yaml'),
586
+ 'message.text-format',
555
587
  ],
556
- [tr("yaml/multipleFilesFolderExample/de-DE/two.yaml"), "test.drive.four"],
588
+ [tr('yaml/multipleFilesFolderExample/de-DE/two.yaml'), 'test.drive.four'],
557
589
  ],
558
590
  ])}
559
591
 
560
592
  Found invalid keys!
561
593
  ${(0, errorReporters_1.formatTable)([
562
- [["info", "result"]],
594
+ [['info', 'result']],
563
595
  [
564
- ["file", tr("yaml/multipleFilesFolderExample/de-DE/one.yaml")],
565
- ["key", "message.select"],
596
+ ['file', tr('yaml/multipleFilesFolderExample/de-DE/one.yaml')],
597
+ ['key', 'message.select'],
566
598
  [
567
- "msg",
599
+ 'msg',
568
600
  'Expected element of type "select" but received "argument", Unexpected date element, Unexpected date element...',
569
601
  ],
570
602
  ],
571
603
  [
572
- ["file", tr("yaml/multipleFilesFolderExample/de-DE/three.yaml")],
573
- ["key", "multipleVariables"],
574
- ["msg", 'Expected argument to contain "user" but received "name"'],
604
+ ['file', tr('yaml/multipleFilesFolderExample/de-DE/three.yaml')],
605
+ ['key', 'multipleVariables'],
606
+ ['msg', 'Expected argument to contain "user" but received "name"'],
575
607
  ],
576
608
  ])}
577
609
 
578
610
  `);
579
611
  });
580
- it("should return the missing/invalid keys for folder containing multiple locale folders", async () => {
581
- const stdout = await execAsync("node dist/bin/index.js -l translations/yaml/multipleFoldersExample -s en-US");
582
- const result = stdout.split("Done")[0];
612
+ it('should return the missing/invalid keys for folder containing multiple locale folders', async () => {
613
+ const stdout = await execAsync('node dist/bin/index.js -l translations/yaml/multipleFoldersExample -s en-US');
614
+ const result = stdout.split('Done')[0];
583
615
  expect(result).toEqual(`i18n translations checker
584
616
  Source: en-US
585
617
 
586
618
  Found missing keys!
587
619
  ${(0, errorReporters_1.formatTable)([
588
- [["file", "key"]],
620
+ [['file', 'key']],
589
621
  [
590
- [ymlMultiFolders("spaceOne/locales/de-DE/one.yaml"), "message.text-format"],
591
- [ymlMultiFolders("spaceOne/locales/de-DE/two.yaml"), "test.drive.four"],
592
- [ymlMultiFolders("spaceTwo/locales/de-DE/one.yaml"), "message.plural"],
593
- [ymlMultiFolders("spaceTwo/locales/de-DE/two.yaml"), "test.drive.two"],
622
+ [ymlMultiFolders('spaceOne/locales/de-DE/one.yaml'), 'message.text-format'],
623
+ [ymlMultiFolders('spaceOne/locales/de-DE/two.yaml'), 'test.drive.four'],
624
+ [ymlMultiFolders('spaceTwo/locales/de-DE/one.yaml'), 'message.plural'],
625
+ [ymlMultiFolders('spaceTwo/locales/de-DE/two.yaml'), 'test.drive.two'],
594
626
  ],
595
627
  ])}
596
628
 
597
629
  Found invalid keys!
598
630
  ${(0, errorReporters_1.formatTable)([
599
- [["info", "result"]],
631
+ [['info', 'result']],
600
632
  [
601
- ["file", ymlMultiFolders("spaceOne/locales/de-DE/one.yaml")],
602
- ["key", "message.select"],
633
+ ['file', ymlMultiFolders('spaceOne/locales/de-DE/one.yaml')],
634
+ ['key', 'message.select'],
603
635
  [
604
- "msg",
636
+ 'msg',
605
637
  'Expected element of type "select" but received "argument", Unexpected date element, Unexpected date element...',
606
638
  ],
607
639
  ],
608
640
  [
609
- ["file", ymlMultiFolders("spaceOne/locales/de-DE/three.yaml")],
610
- ["key", "multipleVariables"],
611
- ["msg", 'Expected argument to contain "user" but received "name"'],
641
+ ['file', ymlMultiFolders('spaceOne/locales/de-DE/three.yaml')],
642
+ ['key', 'multipleVariables'],
643
+ ['msg', 'Expected argument to contain "user" but received "name"'],
612
644
  ],
613
645
  [
614
- ["file", ymlMultiFolders("spaceTwo/locales/de-DE/one.yaml")],
615
- ["key", "message.text-format"],
646
+ ['file', ymlMultiFolders('spaceTwo/locales/de-DE/one.yaml')],
647
+ ['key', 'message.text-format'],
616
648
  [
617
- "msg",
649
+ 'msg',
618
650
  'Expected element of type "tag" but received "number", Unexpected tag element',
619
651
  ],
620
652
  ],
621
653
  [
622
- ["file", ymlMultiFolders("spaceTwo/locales/de-DE/three.yaml")],
623
- ["key", "numberFormat"],
624
- ["msg", "Missing element number"],
654
+ ['file', ymlMultiFolders('spaceTwo/locales/de-DE/three.yaml')],
655
+ ['key', 'numberFormat'],
656
+ ['msg', 'Missing element number'],
625
657
  ],
626
658
  ])}
627
659
 
628
660
  `);
629
661
  });
630
- it("should return the missing/invalid keys for multiple locale folders", async () => {
631
- const stdout = await execAsync("node dist/bin/index.js -l translations/yaml/multipleFoldersExample/spaceOne translations/yaml/multipleFoldersExample/spaceTwo -s en-US");
632
- const result = stdout.split("Done")[0];
662
+ it('should return the missing/invalid keys for multiple locale folders', async () => {
663
+ const stdout = await execAsync('node dist/bin/index.js -l translations/yaml/multipleFoldersExample/spaceOne translations/yaml/multipleFoldersExample/spaceTwo -s en-US');
664
+ const result = stdout.split('Done')[0];
633
665
  expect(result).toEqual(`i18n translations checker
634
666
  Source: en-US
635
667
 
636
668
  Found missing keys!
637
669
  ${(0, errorReporters_1.formatTable)([
638
- [["file", "key"]],
670
+ [['file', 'key']],
639
671
  [
640
- [ymlMultiFolders("spaceOne/locales/de-DE/one.yaml"), "message.text-format"],
641
- [ymlMultiFolders("spaceOne/locales/de-DE/two.yaml"), "test.drive.four"],
642
- [ymlMultiFolders("spaceTwo/locales/de-DE/one.yaml"), "message.plural"],
643
- [ymlMultiFolders("spaceTwo/locales/de-DE/two.yaml"), "test.drive.two"],
672
+ [ymlMultiFolders('spaceOne/locales/de-DE/one.yaml'), 'message.text-format'],
673
+ [ymlMultiFolders('spaceOne/locales/de-DE/two.yaml'), 'test.drive.four'],
674
+ [ymlMultiFolders('spaceTwo/locales/de-DE/one.yaml'), 'message.plural'],
675
+ [ymlMultiFolders('spaceTwo/locales/de-DE/two.yaml'), 'test.drive.two'],
644
676
  ],
645
677
  ])}
646
678
 
647
679
  Found invalid keys!
648
680
  ${(0, errorReporters_1.formatTable)([
649
- [["info", "result"]],
681
+ [['info', 'result']],
650
682
  [
651
- ["file", ymlMultiFolders("spaceOne/locales/de-DE/one.yaml")],
652
- ["key", "message.select"],
683
+ ['file', ymlMultiFolders('spaceOne/locales/de-DE/one.yaml')],
684
+ ['key', 'message.select'],
653
685
  [
654
- "msg",
686
+ 'msg',
655
687
  'Expected element of type "select" but received "argument", Unexpected date element, Unexpected date element...',
656
688
  ],
657
689
  ],
658
690
  [
659
- ["file", ymlMultiFolders("spaceOne/locales/de-DE/three.yaml")],
660
- ["key", "multipleVariables"],
661
- ["msg", 'Expected argument to contain "user" but received "name"'],
691
+ ['file', ymlMultiFolders('spaceOne/locales/de-DE/three.yaml')],
692
+ ['key', 'multipleVariables'],
693
+ ['msg', 'Expected argument to contain "user" but received "name"'],
662
694
  ],
663
695
  [
664
- ["file", ymlMultiFolders("spaceTwo/locales/de-DE/one.yaml")],
665
- ["key", "message.text-format"],
696
+ ['file', ymlMultiFolders('spaceTwo/locales/de-DE/one.yaml')],
697
+ ['key', 'message.text-format'],
666
698
  [
667
- "msg",
699
+ 'msg',
668
700
  'Expected element of type "tag" but received "number", Unexpected tag element',
669
701
  ],
670
702
  ],
671
703
  [
672
- ["file", ymlMultiFolders("spaceTwo/locales/de-DE/three.yaml")],
673
- ["key", "numberFormat"],
674
- ["msg", "Missing element number"],
704
+ ['file', ymlMultiFolders('spaceTwo/locales/de-DE/three.yaml')],
705
+ ['key', 'numberFormat'],
706
+ ['msg', 'Missing element number'],
675
707
  ],
676
708
  ])}
677
709
 
678
710
  `);
679
711
  });
680
- it("should return the missing/invalid keys for all files in the provided locale folders", async () => {
681
- const stdout = await execAsync("node dist/bin/index.js --source en-US --locales translations/yaml/flattenExamples translations/yaml/messageExamples");
682
- const result = stdout.split("Done")[0];
712
+ it('should return the missing/invalid keys for all files in the provided locale folders', async () => {
713
+ const stdout = await execAsync('node dist/bin/index.js --source en-US --locales translations/yaml/flattenExamples translations/yaml/messageExamples');
714
+ const result = stdout.split('Done')[0];
683
715
  expect(result).toEqual(`i18n translations checker
684
716
  Source: en-US
685
717
 
686
718
  Found missing keys!
687
719
  ${(0, errorReporters_1.formatTable)([
688
- [["file", "key"]],
720
+ [['file', 'key']],
689
721
  [
690
- [tr("yaml/flattenExamples/de-de.yaml"), "other.nested.three"],
691
- [tr("yaml/flattenExamples/de-de.yaml"), "other.nested.deep.more.final"],
692
- [tr("yaml/messageExamples/de-de.yaml"), "richText"],
693
- [tr("yaml/messageExamples/de-de.yaml"), "yo"],
694
- [tr("yaml/messageExamples/de-de.yaml"), "nesting1"],
695
- [tr("yaml/messageExamples/de-de.yaml"), "nesting2"],
696
- [tr("yaml/messageExamples/de-de.yaml"), "nesting3"],
697
- [tr("yaml/messageExamples/de-de.yaml"), "key1"],
722
+ [tr('yaml/flattenExamples/de-de.yaml'), 'other.nested.three'],
723
+ [tr('yaml/flattenExamples/de-de.yaml'), 'other.nested.deep.more.final'],
724
+ [tr('yaml/messageExamples/de-de.yaml'), 'richText'],
725
+ [tr('yaml/messageExamples/de-de.yaml'), 'yo'],
726
+ [tr('yaml/messageExamples/de-de.yaml'), 'nesting1'],
727
+ [tr('yaml/messageExamples/de-de.yaml'), 'nesting2'],
728
+ [tr('yaml/messageExamples/de-de.yaml'), 'nesting3'],
729
+ [tr('yaml/messageExamples/de-de.yaml'), 'key1'],
698
730
  ],
699
731
  ])}
700
732
 
701
733
  Found invalid keys!
702
734
  ${(0, errorReporters_1.formatTable)([
703
- [["info", "result"]],
735
+ [['info', 'result']],
704
736
  [
705
- ["file", tr("yaml/messageExamples/de-de.yaml")],
706
- ["key", "multipleVariables"],
707
- ["msg", "Unexpected date element"],
737
+ ['file', tr('yaml/messageExamples/de-de.yaml')],
738
+ ['key', 'multipleVariables'],
739
+ ['msg', 'Unexpected date element'],
708
740
  ],
709
741
  ])}
710
742
 
711
743
  `);
712
744
  });
713
- it("should return the missing/invalid keys for all files with source matching folder and source matching file", async () => {
714
- const stdout = await execAsync("node dist/bin/index.js -l translations/yaml/multipleFilesFolderExample translations/yaml/flattenExamples -s en-US");
715
- const result = stdout.split("Done")[0];
745
+ it('should return the missing/invalid keys for all files with source matching folder and source matching file', async () => {
746
+ const stdout = await execAsync('node dist/bin/index.js -l translations/yaml/multipleFilesFolderExample translations/yaml/flattenExamples -s en-US');
747
+ const result = stdout.split('Done')[0];
716
748
  expect(result).toEqual(`i18n translations checker
717
749
  Source: en-US
718
750
 
719
751
  Found missing keys!
720
752
  ${(0, errorReporters_1.formatTable)([
721
- [["file", "key"]],
753
+ [['file', 'key']],
722
754
  [
723
- [tr("yaml/flattenExamples/de-de.yaml"), "other.nested.three"],
724
- [tr("yaml/flattenExamples/de-de.yaml"), "other.nested.deep.more.final"],
755
+ [tr('yaml/flattenExamples/de-de.yaml'), 'other.nested.three'],
756
+ [tr('yaml/flattenExamples/de-de.yaml'), 'other.nested.deep.more.final'],
725
757
  [
726
- tr("yaml/multipleFilesFolderExample/de-DE/one.yaml"),
727
- "message.text-format",
758
+ tr('yaml/multipleFilesFolderExample/de-DE/one.yaml'),
759
+ 'message.text-format',
728
760
  ],
729
- [tr("yaml/multipleFilesFolderExample/de-DE/two.yaml"), "test.drive.four"],
761
+ [tr('yaml/multipleFilesFolderExample/de-DE/two.yaml'), 'test.drive.four'],
730
762
  ],
731
763
  ])}
732
764
 
733
765
  Found invalid keys!
734
766
  ${(0, errorReporters_1.formatTable)([
735
- [["info", "result"]],
767
+ [['info', 'result']],
736
768
  [
737
- ["file", tr("yaml/multipleFilesFolderExample/de-DE/one.yaml")],
738
- ["key", "message.select"],
769
+ ['file', tr('yaml/multipleFilesFolderExample/de-DE/one.yaml')],
770
+ ['key', 'message.select'],
739
771
  [
740
- "msg",
772
+ 'msg',
741
773
  'Expected element of type "select" but received "argument", Unexpected date element, Unexpected date element...',
742
774
  ],
743
775
  ],
744
776
  [
745
- ["file", tr("yaml/multipleFilesFolderExample/de-DE/three.yaml")],
746
- ["key", "multipleVariables"],
747
- ["msg", 'Expected argument to contain "user" but received "name"'],
777
+ ['file', tr('yaml/multipleFilesFolderExample/de-DE/three.yaml')],
778
+ ['key', 'multipleVariables'],
779
+ ['msg', 'Expected argument to contain "user" but received "name"'],
748
780
  ],
749
781
  ])}
750
782