diff --git a/packages/httpsnippet-client-api/__tests__/index.test.js b/packages/httpsnippet-client-api/__tests__/index.test.js index 196dbfd9..f505563f 100644 --- a/packages/httpsnippet-client-api/__tests__/index.test.js +++ b/packages/httpsnippet-client-api/__tests__/index.test.js @@ -7,6 +7,8 @@ const HTTPSnippet = require('@readme/httpsnippet'); const path = require('path'); const client = require('../src'); +HTTPSnippet.addTargetClient('node', client); + test('it should have info', () => { expect(client).toHaveProperty('info'); expect(typeof client.info).toBe('object'); @@ -22,8 +24,6 @@ test('it should have info', () => { }); test('it should error if no apiDefinitionUri was supplied', async () => { - HTTPSnippet.addTargetClient('node', client); - const har = await fs.readFile(path.join(__dirname, `./__fixtures__/request/petstore/har.json`), 'utf8'); const snippet = new HTTPSnippet(JSON.parse(har)); @@ -33,8 +33,6 @@ test('it should error if no apiDefinitionUri was supplied', async () => { }); test('it should error if no apiDefinition was supplied', async () => { - HTTPSnippet.addTargetClient('node', client); - const har = await fs.readFile(path.join(__dirname, `./__fixtures__/request/petstore/har.json`), 'utf8'); const snippet = new HTTPSnippet(JSON.parse(har)); @@ -46,10 +44,6 @@ test('it should error if no apiDefinition was supplied', async () => { }); describe('snippets', () => { - beforeAll(() => { - HTTPSnippet.addTargetClient('node', client); - }); - it.each([ ['application-form-encoded'], ['application-json'], diff --git a/packages/httpsnippet-client-api/package-lock.json b/packages/httpsnippet-client-api/package-lock.json index 071c3644..daa684af 100644 --- a/packages/httpsnippet-client-api/package-lock.json +++ b/packages/httpsnippet-client-api/package-lock.json @@ -1604,9 +1604,9 @@ } }, "@readme/httpsnippet": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@readme/httpsnippet/-/httpsnippet-2.0.1.tgz", - "integrity": "sha512-yeQemCwfzF4ll4yqWaJ+Dv2m/srwAf4VxM9E1Kkz75A/q5+uqmX6ttSsK+NJl+s1G4btY30/D3OuEErtCUq6BQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@readme/httpsnippet/-/httpsnippet-2.1.1.tgz", + "integrity": "sha512-7vpyeyPqjhIeWI/vFY+eHzebK9cCayDlGYkRRtbpNfpINWEjlONcK6PHs60GS55WJpLhNeECV7UQYEui5QVaiA==", "requires": { "event-stream": "4.0.1", "form-data": "3.0.0", @@ -2709,9 +2709,9 @@ } }, "duplexer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", - "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=" + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", + "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==" }, "ecc-jsbn": { "version": "0.1.2", @@ -5867,12 +5867,6 @@ "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true - }, "json-parse-even-better-errors": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.0.tgz",