Skip to content
This repository was archived by the owner on Nov 28, 2022. It is now read-only.

Commit 41f40da

Browse files
author
Dom Harrington
committed
Make tests work in api-explorer
1 parent 429b146 commit 41f40da

24 files changed

+2261
-6392
lines changed

packages/api-explorer/.babelrc

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"env": {
33
"jest": true
4-
}
4+
},
5+
"rules": {
6+
"import/no-extraneous-dependencies": 0,
7+
},
58
}

packages/api-explorer/__tests__/Doc.test.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const extensions = require('@readme/oas-extensions/');
1+
const extensions = require('@readme/oas-extensions');
22
const { Request, Response } = require('node-fetch');
33

44
global.Request = Request;

packages/api-explorer/__tests__/form-components/DescriptionField.test.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const React = require('react');
22
const { shallow } = require('enzyme');
33
const DescriptionField = require('../../src/form-components/DescriptionField');
4-
const markdown = require('../../src/lib/markdown');
4+
const markdown = require('@readme/markdown');
55

66
test('should parse description as markdown', () => {
77
const actual = '`all` or a comma-separated list of action [fields](ref:action-object)';

packages/api-explorer/__tests__/lib/generate-code-snippet.test.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@ test('should pass through values to code snippet', () => {
3535
});
3636

3737
test('should not contain proxy url', () => {
38-
const snippet = shallow(generateCodeSnippet(
39-
Object.assign({}, oas, { [extensions.PROXY_ENABLED]: true }),
40-
operation,
41-
values,
42-
'node',
43-
));
38+
const snippet = shallow(
39+
generateCodeSnippet(
40+
Object.assign({}, oas, { [extensions.PROXY_ENABLED]: true }),
41+
operation,
42+
values,
43+
'node',
44+
),
45+
);
4446

4547
expect(snippet.text()).toEqual(expect.stringMatching('http://example.com/path/123'));
4648
});

packages/api-explorer/arrow-function-coverage-fix.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

packages/api-explorer/jest.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const config = require('../../jest.config');
2+
3+
module.exports = {
4+
...config,
5+
rootDir: './',
6+
};

0 commit comments

Comments
 (0)