Skip to content

Commit

Permalink
test: use OPTIONS fixture in cacheOptions functional test
Browse files Browse the repository at this point in the history
  • Loading branch information
unicornware committed Sep 19, 2021
1 parent dd4c3a0 commit b8c5c26
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { IGreaseOptions } from '@grease/interfaces'
import GreaseOptions from '@grease/models/grease-options.model'
import { TAGS_OPTIONS_LERNA } from '@grease/tests/fixtures/git-tags.fixture'
import OPTIONS from '@grease/tests/fixtures/options.fixture'
import validate from '@grease/utils/validate.util'
import testSubject from '../cache-options.util'

Expand All @@ -14,18 +13,12 @@ jest.mock('@grease/utils/validate.util')
const mockValidate = validate as jest.MockedFunction<typeof validate>

describe('functional:utils/cacheOptions', () => {
const options: IGreaseOptions = {
lernaPackage: TAGS_OPTIONS_LERNA.package,
skipUnstable: TAGS_OPTIONS_LERNA.skipUnstable,
tagPrefix: TAGS_OPTIONS_LERNA.tagPrefix
}

beforeEach(async () => {
await testSubject(options)
await testSubject(OPTIONS)
})

it('should validate application options', () => {
expect(mockValidate).toBeCalledTimes(1)
expect(mockValidate).toBeCalledWith(GreaseOptions, options, false)
expect(mockValidate).toBeCalledWith(GreaseOptions, OPTIONS, false)
})
})

0 comments on commit b8c5c26

Please sign in to comment.