Skip to content

Commit

Permalink
fix: export unitTestUtils functions as a module (#76)
Browse files Browse the repository at this point in the history
* fix: export unitTestUtils as a module

* added test to verify unitTestUtils and its functions are exported
  • Loading branch information
SaltedCaramelCoffee authored Jan 9, 2020
1 parent 1f03ff8 commit a148da9
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
33 changes: 33 additions & 0 deletions test/unit/export-unit-test-utils.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
'use strict';

const { unitTestUtils } = require('../../dist');

describe('Unit Test Utils', () => {
it('should be defined', () => {
expect(unitTestUtils).toBeDefined();
});

it('should have function checkUrlAndMethod', () => {
expect(unitTestUtils.checkUrlAndMethod).toBeDefined();
});

it('should have function checkMediaHeaders', () => {
expect(unitTestUtils.checkMediaHeaders).toBeDefined();
});

it('should have function checkUserHeader', () => {
expect(unitTestUtils.checkUserHeader).toBeDefined();
});

it('should have function checkForSuccessfulExecution', () => {
expect(unitTestUtils.checkForSuccessfulExecution).toBeDefined();
});

it('should have function getOptions', () => {
expect(unitTestUtils.getOptions).toBeDefined();
});

it('should have function expectToBePromise', () => {
expect(unitTestUtils.expectToBePromise).toBeDefined();
});
});
5 changes: 3 additions & 2 deletions test/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
/*
* The utility methods in this directory are not to assist in the testing
* of the core, but to assist with the testing of the SDKs that depend on
* this core library. Specifically, the unit tests generated by the
* this core library. Specifically, the unit tests generated by the
* IBM OpenAPI SDK Gen project rely on these methods.
*/

export * from './unit-test-helpers'
import * as unitTestUtils from './unit-test-helpers';
export { unitTestUtils };

0 comments on commit a148da9

Please sign in to comment.