Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
refactor: ensures same export type of modules
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-zakharchenko committed May 16, 2019
1 parent 4bf7781 commit 2805ad1
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/api/test/integration/validataElement.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { assert } = require('chai');
const validateElement = require('../../validateElement');
const { validateElement } = require('../../validateElement');

describe('validateElement', () => {
describe('with matching requests', () => {
Expand Down
4 changes: 3 additions & 1 deletion lib/api/test/unit/units/normalize/normalizeHeaders.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const { assert } = require('chai');
const normalizeHeaders = require('../../../../units/normalize/normalizeHeaders');
const {
normalizeHeaders
} = require('../../../../units/normalize/normalizeHeaders');

describe('normalizeHeaders', () => {
describe('when given nothing', () => {
Expand Down
2 changes: 1 addition & 1 deletion lib/api/test/unit/units/validateHeaders.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { assert } = require('chai');
const validateHeaders = require('../../../units/validateHeaders');
const { validateHeaders } = require('../../../units/validateHeaders');

describe('validateHeaders', () => {
describe('given matching headers', () => {
Expand Down
2 changes: 1 addition & 1 deletion lib/api/test/unit/units/validateStatusCode.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { assert } = require('chai');
const validateStatusCode = require('../../../units/validateStatusCode');
const { validateStatusCode } = require('../../../units/validateStatusCode');

describe('validateStatusCode', () => {
describe('given matching status codes', () => {
Expand Down
4 changes: 2 additions & 2 deletions lib/api/units/normalize/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const evolve = require('../../utils/evolve');
const normalizeHeaders = require('./normalizeHeaders');
const { normalizeHeaders } = require('./normalizeHeaders');

const normalize = evolve({
headers: normalizeHeaders
});

module.exports = normalize;
module.exports = { normalize };
2 changes: 1 addition & 1 deletion lib/api/units/normalize/normalizeHeaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ const normalizeHeaders = (headers) => {
);
};

module.exports = normalizeHeaders;
module.exports = { normalizeHeaders };
2 changes: 1 addition & 1 deletion lib/api/units/validateHeaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ and expected data media type
};
}

module.exports = validateHeaders;
module.exports = { validateHeaders };
2 changes: 1 addition & 1 deletion lib/api/units/validateStatusCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ function validateStatusCode(real, expected) {
};
}

module.exports = validateStatusCode;
module.exports = { validateStatusCode };
4 changes: 2 additions & 2 deletions lib/api/validate.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const normalize = require('./units/normalize');
const validateElement = require('./validateElement');
const { normalize } = require('./units/normalize');
const { validateElement } = require('./validateElement');

function validate(real, expected, type, callback) {
const normalizedReal = normalize(real);
Expand Down
6 changes: 3 additions & 3 deletions lib/api/validateElement.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const isset = require('../utils/isset');
const validateStatusCode = require('./units/validateStatusCode');
const validateHeaders = require('./units/validateHeaders');
const { validateStatusCode } = require('./units/validateStatusCode');
const { validateHeaders } = require('./units/validateHeaders');
const { validateBody } = require('./units/validateBody');

function validateElement(real, expected) {
Expand All @@ -24,4 +24,4 @@ function validateElement(real, expected) {
return results;
}

module.exports = validateElement;
module.exports = { validateElement };

0 comments on commit 2805ad1

Please sign in to comment.