Skip to content
Myr

Make the package a module type (#313)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sindre Sorhus · committed by GitHub · parent 3038671 · Browse files · 10 files+27 added−13 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

10 files+27 added−13 removed

  • tests:+11 added−10 removed
  • other:+16 added−3 removed

10 files+27 added−13 removed

modified:test/browser.js+3 added-2 removed
1import util from 'util';2import body from 'body';3import {serial as test} from 'ava';3import ava from 'ava'; // eslint-disable-line ava/use-test4import createTestServer from 'create-test-server';5import Busboy from 'busboy';6import withPage from './helpers/with-page';6import withPage from './helpers/with-page.js';78const test = ava.serial;9const pBody = util.promisify(body);1011test('prefixUrl option', withPage, async (t, page) => {12 const server = await createTestServer();
354 unmodified lines
modified:test/fetch.js+1 added-1 removed
modified:test/headers.js+1 added-1 removed
1import createTestServer from 'create-test-server';2import FormData from 'form-data';3import test from 'ava';4import ky from '..';4import ky from '../index.js';56const echoHeaders = (request, response) => {7 request.resume();8 response.end(JSON.stringify(request.headers));
392 unmodified lines
modified:test/hooks.js+1 added-1 removed
1 unmodified line
2import test from 'ava';3import createTestServer from 'create-test-server';4import body from 'body';5import delay from 'delay';6import ky from '..';6import ky from '../index.js';78const pBody = util.promisify(body);910test('hooks can be async', async t => {
577 unmodified lines
modified:test/http-error.js+1 added-1 removed
modified:test/main.js+1 added-1 removed
1 unmodified line
2import test from 'ava';3import createTestServer from 'create-test-server';4import body from 'body';5import delay from 'delay';6import ky from '..';6import ky from '../index.js';78const pBody = util.promisify(body);9const fixture = 'fixture';10
624 unmodified lines
modified:test/methods.js+1 added-1 removed
modified:test/prefix-url.js+1 added-1 removed
modified:test/retry.js+1 added-1 removed
1import test from 'ava';2import createTestServer from 'create-test-server';3import ky from '..';3import ky from '../index.js';45const fixture = 'fixture';6const defaultRetryCount = 2;7const retryAfterOn413 = 2;
433 unmodified lines
modified:package.json+16 added-3 removed
8 unmodified lines
9 "name": "Sindre Sorhus",10 "email": "sindresorhus@gmail.com",11 "url": "https://sindresorhus.com"12 },13 "type": "module",14 "exports": {15 "import": "./index.js",16 "require": "./umd.js"17 },18 "engines": {19 "node": ">=10"20 },21 "scripts": {
30 unmodified lines
52 "node-fetch"53 ],54 "devDependencies": {55 "abort-controller": "^3.0.0",51 "ava": "^3.2.0",56 "ava": "^3.15.0",57 "body": "^5.1.0",58 "busboy": "^0.3.1",59 "create-test-server": "2.1.1",60 "delay": "^4.1.0",
12 unmodified lines
73 "browser"74 ],75 "globals": [76 "globalThis"72 ]77 ],78 "rules": {79 "import/no-useless-path-segments": "off",80 "unicorn/import-index": "off",81 "import/extensions": "off"82 }83 },84 "ava": {85 "require": [86 "esm",87 "./test/_require"78 ]88 ],89 "nonSemVerExperiments": {90 "nextGenConfig": true91 }92 },93 "tsd": {94 "compilerOptions": {95 "lib": [
12 unmodified lines