Skip to content

Commit

Permalink
[continuous-deploy-fingerprint] Clean up code slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
wschurman committed Sep 24, 2024
1 parent 6c50f92 commit eebde89
Show file tree
Hide file tree
Showing 16 changed files with 174 additions and 206 deletions.
144 changes: 61 additions & 83 deletions build/continuous-deploy-fingerprint/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import {
DEFAULT_MESSAGE,
commentAction,
commentInput,
} from '../../src/actions/preview-comment';
import * as expo from '../../src/expo';
import * as github from '../../src/github';
} from '../../actions/preview-comment';
import * as expo from '../../expo';
import * as github from '../../github';
import { mockInput } from '../utils';

jest.mock('@actions/core');
jest.mock('../../src/expo');
jest.mock('../../src/github');
jest.mock('../../src/worker');
jest.mock('../../expo');
jest.mock('../../github');
jest.mock('../../worker');

describe(commentInput, () => {
it('returns object with correct defaults', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ExpoConfig } from '@expo/config';

import { createSummary, getVariables, previewInput } from '../../src/actions/preview';
import { EasUpdate } from '../../src/eas';
import { createSummary, getVariables, previewInput } from '../../actions/preview';
import { EasUpdate } from '../../eas';

jest.mock('../../src/expo');
jest.mock('../../expo');

const fakeOptions = {
qrTarget: 'dev-client',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import * as core from '@actions/core';

import { setupAction, setupInput } from '../../src/actions/setup';
import * as cacher from '../../src/cacher';
import * as expo from '../../src/expo';
import * as packager from '../../src/packager';
import * as worker from '../../src/worker';
import { setupAction, setupInput } from '../../actions/setup';
import * as cacher from '../../cacher';
import * as expo from '../../expo';
import * as packager from '../../packager';
import * as worker from '../../worker';
import { mockInput } from '../utils';

jest.mock('@actions/core');
jest.mock('../../src/cacher');
jest.mock('../../src/expo');
jest.mock('../../src/packager');
jest.mock('../../src/worker');
jest.mock('../../cacher');
jest.mock('../../expo');
jest.mock('../../packager');
jest.mock('../../worker');

describe(setupInput, () => {
it('returns object with correct defaults', () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/cacher.test.ts → src/__tests__/cacher.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import * as cache from '@actions/cache';
import os from 'os';

import { resetEnv, setEnv } from './utils';
import { cacheKey, restoreFromCache, saveToCache } from '../src/cacher';
import { toolPath } from '../src/worker';
import { cacheKey, restoreFromCache, saveToCache } from '../cacher';
import { toolPath } from '../worker';

jest.mock('@actions/cache');
jest.mock('@actions/core');
Expand Down
6 changes: 3 additions & 3 deletions tests/comment.test.ts → src/__tests__/comment.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ExpoConfig } from '@expo/config';

import { getQrTarget, getSchemesInOrderFromConfig } from '../src/comment';
import { projectAppType } from '../src/expo';
import { getQrTarget, getSchemesInOrderFromConfig } from '../comment';
import { projectAppType } from '../expo';

jest.mock('../src/expo');
jest.mock('../expo');

const fakeOptions = {
workingDirectory: '',
Expand Down
2 changes: 1 addition & 1 deletion tests/eas.test.ts → src/__tests__/eas.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getUpdateGroupQr } from '../src/eas';
import { getUpdateGroupQr } from '../eas';

describe(getUpdateGroupQr, () => {
it('returns url for expo-go', () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/expo.test.ts → src/__tests__/expo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as core from '@actions/core';
import * as exec from '@actions/exec';
import * as io from '@actions/io';

import { authenticate, parseCommand, projectDeepLink, projectLink, projectQR } from '../src/expo';
import { authenticate, parseCommand, projectDeepLink, projectLink, projectQR } from '../expo';

jest.mock('@actions/core');
jest.mock('@actions/exec');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { FingerprintSource } from '@expo/fingerprint';

import { FingerprintDbManager } from '../../src/fingerprint/FingerprintDbManager';
import { FingerprintDbManager } from '../../fingerprint/FingerprintDbManager';

describe(FingerprintDbManager, () => {
let fingerprintDbManager: FingerprintDbManager;
Expand Down
2 changes: 1 addition & 1 deletion tests/github.test.ts → src/__tests__/github.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as github from '@actions/github';

import { resetEnv, setEnv } from './utils';
import { githubApi, pullContext } from '../src/github';
import { githubApi, pullContext } from '../github';

jest.mock('@actions/github');

Expand Down
2 changes: 1 addition & 1 deletion tests/packager.test.ts → src/__tests__/packager.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { resolvePackage } from '../src/packager';
import { resolvePackage } from '../packager';

describe(resolvePackage, () => {
it('resolves expo-cli@^2.0.0 to 2.21.2', async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/sqlite.test.ts → src/__tests__/sqlite.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Database, openDatabaseAsync } from '../src/sqlite';
import { Database, openDatabaseAsync } from '../sqlite';

describe(openDatabaseAsync, () => {
let db: Database;
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/worker.test.ts → src/__tests__/worker.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
patchWatchers,
tempPath,
toolPath,
} from '../src/worker';
} from '../worker';

jest.mock('@actions/core');
jest.mock('@actions/exec');
Expand Down
Loading

0 comments on commit eebde89

Please sign in to comment.