diff options
author | Kirill Rogovoy <[email protected]> | 2021-07-19 20:06:08 +0300 |
---|---|---|
committer | Kirill Rogovoy <[email protected]> | 2021-07-19 20:06:08 +0300 |
commit | f0bf4e7afdcd8b02a62be45ab3e7d047ed865a79 (patch) | |
tree | 575c0ff2cbb846252bd2e494c81c396846aab2f6 /test | |
parent | 67ad38d0a7cd319623e9f41c0c381ed5c5f6f973 (diff) |
Apply Prettier
Diffstat (limited to 'test')
-rw-r--r-- | test/i18n.test.ts | 14 | ||||
-rw-r--r-- | test/mock-async-storage.ts | 4 | ||||
-rw-r--r-- | test/mock-file.ts | 2 | ||||
-rw-r--r-- | test/mock-i18n.ts | 2 | ||||
-rw-r--r-- | test/mock-react-native-image.ts | 6 | ||||
-rw-r--r-- | test/setup.ts | 10 | ||||
-rw-r--r-- | test/storyshots.test.ts | 6 |
7 files changed, 22 insertions, 22 deletions
diff --git a/test/i18n.test.ts b/test/i18n.test.ts index 61a4963..913054e 100644 --- a/test/i18n.test.ts +++ b/test/i18n.test.ts @@ -1,5 +1,5 @@ -const en = require("../app/i18n/en.json") -const { exec } = require("child_process") +const en = require('../app/i18n/en.json') +const { exec } = require('child_process') // Use this array for keys that for whatever reason aren't greppable so they // don't hold your test suite hostage by always failing. @@ -10,7 +10,7 @@ const EXCEPTIONS = [ function iterate(obj, stack, array) { for (const property in obj) { if (Object.prototype.hasOwnProperty.call(obj, property)) { - if (typeof obj[property] === "object") { + if (typeof obj[property] === 'object') { iterate(obj[property], `${stack}.${property}`, array) } else { array.push(`${stack.slice(1)}.${property}`) @@ -40,14 +40,14 @@ function iterate(obj, stack, array) { * */ -describe("i18n", () => { - test("There are no missing keys", (done) => { +describe('i18n', () => { + test('There are no missing keys', (done) => { // Actual command output: // grep "Tx=\"\S*\"\|tx=\"\S*\"\|translate(\"\S*\"" -ohr './app' | grep -o "\".*\"" const command = `grep "Tx=\\"\\S*\\"\\|tx=\\"\\S*\\"\\|translate(\\"\\S*\\"" -ohr './app' | grep -o "\\".*\\""` exec(command, (_, stdout) => { - const allTranslationsDefined = iterate(en, "", []) - const allTranslationsUsed = stdout.replace(/"/g, "").split("\n") + const allTranslationsDefined = iterate(en, '', []) + const allTranslationsUsed = stdout.replace(/"/g, '').split('\n') allTranslationsUsed.splice(-1, 1) for (let i = 0; i < allTranslationsUsed.length; i += 1) { diff --git a/test/mock-async-storage.ts b/test/mock-async-storage.ts index a4da056..2b54ced 100644 --- a/test/mock-async-storage.ts +++ b/test/mock-async-storage.ts @@ -1,3 +1,3 @@ -import mockAsyncStorage from "@react-native-async-storage/async-storage/jest/async-storage-mock" +import mockAsyncStorage from '@react-native-async-storage/async-storage/jest/async-storage-mock' -jest.mock("@react-native-async-storage/async-storage", () => mockAsyncStorage) +jest.mock('@react-native-async-storage/async-storage', () => mockAsyncStorage) diff --git a/test/mock-file.ts b/test/mock-file.ts index 5bf851a..5dc8d35 100644 --- a/test/mock-file.ts +++ b/test/mock-file.ts @@ -2,5 +2,5 @@ export default { height: 100, width: 100, scale: 2.0, - uri: "https://placekitten.com/200/200", + uri: 'https://placekitten.com/200/200', } diff --git a/test/mock-i18n.ts b/test/mock-i18n.ts index 47a6417..9f5038f 100644 --- a/test/mock-i18n.ts +++ b/test/mock-i18n.ts @@ -1,4 +1,4 @@ -jest.mock("i18n-js", () => { +jest.mock('i18n-js', () => { return { t: (key) => `${key}.test`, } diff --git a/test/mock-react-native-image.ts b/test/mock-react-native-image.ts index eeae6bb..c01e3ad 100644 --- a/test/mock-react-native-image.ts +++ b/test/mock-react-native-image.ts @@ -1,7 +1,7 @@ -import * as ReactNative from "react-native" -import mockFile from "./mock-file" +import * as ReactNative from 'react-native' +import mockFile from './mock-file' -jest.doMock("react-native", () => { +jest.doMock('react-native', () => { // Extend ReactNative return Object.setPrototypeOf( { diff --git a/test/setup.ts b/test/setup.ts index c0137f2..6fe877a 100644 --- a/test/setup.ts +++ b/test/setup.ts @@ -1,11 +1,11 @@ // we always make sure 'react-native' gets included first -import "react-native" +import 'react-native' // libraries to mock -import "./mock-react-native-image" -import "./mock-async-storage" -import "./mock-i18n" -import "./mock-reactotron" +import './mock-react-native-image' +import './mock-async-storage' +import './mock-i18n' +import './mock-reactotron' jest.useFakeTimers() declare global { diff --git a/test/storyshots.test.ts b/test/storyshots.test.ts index 337aed9..c0a0652 100644 --- a/test/storyshots.test.ts +++ b/test/storyshots.test.ts @@ -1,6 +1,6 @@ -import initStoryshots from "@storybook/addon-storyshots" +import initStoryshots from '@storybook/addon-storyshots' initStoryshots({ - configPath: "./storybook", - framework: "react-native", + configPath: './storybook', + framework: 'react-native', }) |