diff --git a/jest.config.js b/jest.config.js index 3425f2e..8125681 100644 --- a/jest.config.js +++ b/jest.config.js @@ -2,4 +2,9 @@ module.exports = { preset: 'ts-jest', testEnvironment: 'node', testPathIgnorePatterns: ['/dist/', '/node_modules/'], + globals: { + 'ts-jest': { + diagnostics: false, + }, + }, }; diff --git a/src/exo5/exo5.test.ts b/src/exo5/exo5.test.ts new file mode 100644 index 0000000..277580b --- /dev/null +++ b/src/exo5/exo5.test.ts @@ -0,0 +1,101 @@ +import { option } from 'fp-ts'; +import { + getCountryCurrencyOfOptionalCountryCode, + getValidCountryCodeOfCountryNames, + giveCurrencyOfCountryToUser, + performAsyncComputationInParallel, + performAsyncComputationInSequence, + sequenceOptionArray, + sequenceOptionTask, +} from './exo5'; + +describe('exo5', () => { + describe('getCountryCurrencyOfOptionalCountryCode', () => { + it('should return a Task if given a None', async () => { + const result = await getCountryCurrencyOfOptionalCountryCode( + option.none, + )(); + + expect(result).toStrictEqual(option.none); + }); + + it('should return a Task