Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/fixtures/customTarget.ts
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
import type { Target } from '../targets/index.js';

import { request } from '../targets/node/request/client.js';
import { axios } from '../targets/node/axios/client.js';

export const customTarget = {
info: {
key: 'js-variant',
title: 'JavaScript Variant',
extname: '.js',
default: 'request',
default: 'axios',
},
clientsById: {
request,
axios,
},
} as unknown as Target;
35 changes: 6 additions & 29 deletions src/helpers/__snapshots__/utils.test.ts.snap
Original file line numberDiff line numberDiff line change
Expand Up@@ -120,13 +120,6 @@ exports[`availableTargets > returns all available targets 1`] = `
},
{
"clients": [
{
"description": "W3C Standard API that provides scripted client functionality",
"extname": ".js",
"key": "xhr",
"link": "https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest",
"title": "XMLHttpRequest",
},
{
"description": "Promise based HTTP client for the browser and node.js",
"extname": ".js",
Expand All@@ -150,7 +143,7 @@ exports[`availableTargets > returns all available targets 1`] = `
"title": "jQuery",
},
],
"default": "xhr",
"default": "fetch",
"key": "javascript",
"title": "JavaScript",
},
Expand DownExpand Up@@ -185,21 +178,6 @@ exports[`availableTargets > returns all available targets 1`] = `
{
"cli": "node %s",
"clients": [
{
"description": "Node.js native HTTP interface",
"extname": ".cjs",
"key": "native",
"link": "http://nodejs.org/api/http.html#http_http_request_options_callback",
"title": "HTTP",
},
{
"description": "Simplified HTTP request client",
"extname": ".cjs",
"installation": "npm install request --save",
"key": "request",
"link": "https://github.com/request/request",
"title": "Request",
},
{
"description": "Lightweight HTTP Request Client Library",
"extname": ".cjs",
Expand All@@ -216,15 +194,14 @@ exports[`availableTargets > returns all available targets 1`] = `
"title": "Axios",
},
{
"description": "Simplified HTTP node-fetch client",
"extname": ".cjs",
"installation": "npm install node-fetch@2 --save",
"description": "Perform asynchronous HTTP requests with the Fetch API",
"extname": ".js",
"key": "fetch",
"link": "https://github.com/bitinn/node-fetch",
"title": "Fetch",
"link": "https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch",
"title": "fetch",
},
],
"default": "native",
"default": "fetch",
"key": "node",
"title": "Node.js",
},
Expand Down
6 changes: 3 additions & 3 deletions src/targets/index.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -266,18 +266,18 @@ describe('addTarget', () => {
});

it('should add a new custom target', async () => {
const { fetch: fetchClient } = await import('./node/fetch/client');
const { axios: axiosClient } = await import('./node/axios/client');

const deno: Target = {
info: {
// @ts-expect-error intentionally incorrect
key: 'deno',
title: 'Deno',
extname: '.js',
default: 'fetch',
default: 'axios',
},
clientsById: {
fetch: fetchClient,
axios: axiosClient,
},
};

Expand Down
4 changes: 1 addition & 3 deletions src/targets/javascript/target.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,17 +3,15 @@ import type { Target } from '../index.js';
import { axios } from './axios/client.js';
import { fetch } from './fetch/client.js';
import { jquery } from './jquery/client.js';
import { xhr } from './xhr/client.js';

export const javascript: Target = {
info: {
key: 'javascript',
title: 'JavaScript',
default: 'xhr',
default: 'fetch',
},

clientsById: {
xhr,
axios,
fetch,
jquery,
Expand Down
19 changes: 0 additions & 19 deletions src/targets/javascript/xhr/client.test.ts

This file was deleted.

102 changes: 0 additions & 102 deletions src/targets/javascript/xhr/client.ts

This file was deleted.

15 changes: 0 additions & 15 deletions src/targets/javascript/xhr/fixtures/application-form-encoded.js

This file was deleted.

34 changes: 0 additions & 34 deletions src/targets/javascript/xhr/fixtures/application-json.js

This file was deleted.

15 changes: 0 additions & 15 deletions src/targets/javascript/xhr/fixtures/cookies.js

This file was deleted.

13 changes: 0 additions & 13 deletions src/targets/javascript/xhr/fixtures/cors.js

This file was deleted.

14 changes: 0 additions & 14 deletions src/targets/javascript/xhr/fixtures/custom-method.js

This file was deleted.

17 changes: 0 additions & 17 deletions src/targets/javascript/xhr/fixtures/full.js

This file was deleted.

18 changes: 0 additions & 18 deletions src/targets/javascript/xhr/fixtures/headers.js

This file was deleted.

Loading