|
1 | | -import {describe, it} from "mocha"; |
2 | | -import {TEST_SHEET_NAMES, TEST_SPREADSHEET} from "./static/test-doc.spec"; |
3 | | -import {testCredentials} from "./static/test-credentials.spec"; |
| 1 | +import {describe, it} from 'mocha'; |
| 2 | +import {TEST_SHEET_NAMES, TEST_SPREADSHEET} from './static/test-doc.spec'; |
| 3 | +import {testCredentials} from './static/test-credentials.spec'; |
4 | 4 | import { |
5 | 5 | loadSheets, |
6 | 6 | ParsedTranslations, |
7 | 7 | parseSpreadsheets, |
8 | | - writeTranslations |
9 | | -} from "../src"; |
10 | | -import {expect} from "chai"; |
| 8 | + writeTranslations, |
| 9 | +} from '../src'; |
| 10 | +import {expect} from 'chai'; |
11 | 11 |
|
12 | 12 | let translations: ParsedTranslations; |
13 | 13 | const languages = ['EN', 'DE']; |
14 | 14 | const keyColumnName = 'Android'; |
15 | 15 | describe('Write file operations', () => { |
16 | 16 | before(async () => { |
17 | | - await TEST_SPREADSHEET.useServiceAccountAuth(testCredentials) |
18 | | - const sheets = await loadSheets(TEST_SPREADSHEET, { sheetNames: TEST_SHEET_NAMES }); |
19 | | - translations = await parseSpreadsheets(sheets, {languages, keyColumnName}); |
| 17 | + await TEST_SPREADSHEET.useServiceAccountAuth(testCredentials); |
| 18 | + const sheets = await loadSheets(TEST_SPREADSHEET, { |
| 19 | + sheetNames: TEST_SHEET_NAMES, |
| 20 | + }); |
| 21 | + translations = await parseSpreadsheets(sheets, { |
| 22 | + languages, |
| 23 | + keyColumnName, |
| 24 | + }); |
20 | 25 | }); |
21 | 26 |
|
22 | | - it('can save files', () => { |
| 27 | + it('can save files', () => { |
23 | 28 | const path = 'test/i18n'; |
24 | 29 | const res = writeTranslations(path, translations); |
25 | 30 | expect(res).to.be.true; |
26 | 31 | }); |
27 | | - |
28 | | - it('cannot save files with incorrect path', () => { |
29 | | - const path = ''; |
30 | | - const res = writeTranslations(path, translations); |
31 | | - expect(res).to.be.false; |
32 | | - }); |
33 | 32 | }); |
0 commit comments