Skip to content

Commit

Permalink
Sort include mock
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco LUCARELLA committed Dec 27, 2022
1 parent 9b91cf0 commit 807e0d6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions test/objectsCache.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
jest.mock('../src/settings', () => jest.requireActual('./__mocks__/settings').default)

import ObjectsCache from '../src/objectsCache'

const kKey1 = 'key1'
Expand All @@ -7,8 +9,6 @@ const kVal2 = 'val2'
const kFakeDateNow = new Date('2000-01-01')
const kFakeDateAfterExpiration = new Date('2000-01-02')

jest.mock('../src/settings', () => jest.requireActual('./__mocks__/settings').default)

describe('ObjectsCache', () => {
beforeEach(() => {
jest.useFakeTimers().setSystemTime(kFakeDateNow)
Expand Down
6 changes: 3 additions & 3 deletions test/settings.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { EAuthenticationTypes, EColorSchema, IJiraIssueSettings } from "../src/interfaces/settingsInterfaces"
import { DEFAULT_ACCOUNT, DEFAULT_SETTINGS, JiraIssueSettingTab, SettingsData } from "../src/settings"

jest.mock('obsidian')
jest.mock('../src/client/jiraClient', () => jest.requireActual('./__mocks__/jiraClient').default)

import { EAuthenticationTypes, EColorSchema, IJiraIssueSettings } from "../src/interfaces/settingsInterfaces"
import { DEFAULT_ACCOUNT, DEFAULT_SETTINGS, JiraIssueSettingTab, SettingsData } from "../src/settings"

function deepCopy(obj: any): any {
return JSON.parse(JSON.stringify(obj))
}
Expand Down
4 changes: 2 additions & 2 deletions test/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
jest.mock('../src/settings', () => jest.requireActual('./__mocks__/settings').default)

import { getAccountByAlias, getAccountByHost } from '../src/utils'
import { TestAccountBasic, TestAccountOpen } from './__mocks__/settings'

const kAccountNotFound = 'NotExistingAlias'

jest.mock('../src/settings', () => jest.requireActual('./__mocks__/settings').default)

describe('Utils', () => {
test('getAccountByAlias ok', () => {
expect(getAccountByAlias(TestAccountOpen.alias)).toEqual(TestAccountOpen)
Expand Down

0 comments on commit 807e0d6

Please sign in to comment.