Skip to content

Commit a732c5a

Browse files
committed
f
1 parent 7cb8a01 commit a732c5a

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,19 @@ test:
1919

2020
ci:
2121
npm install
22-
npx jest
22+
make unit
2323
make lint
2424
make restart
2525
npx lerna run prepublish
2626
node bundle.js
2727
make e2e
2828
make bundlesize
2929

30+
unit:
31+
npx jest
32+
3033
e2e:
31-
NODE_TLS_REJECT_UNAUTHORIZED=0 npx jest --runInBand --config e2e.config.js
34+
NODE_TLS_REJECT_UNAUTHORIZED=0 npx jest --runInBand --config e2e.config.cjs
3235

3336
clean:
3437
make stop

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@
3939
"uglify-js": "^3.19.3"
4040
},
4141
"scripts": {
42-
"test": "npx jest",
43-
"lint": "eslint --cache .",
4442
"preversion": "make bundle"
4543
},
4644
"engines": {

packages/component/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ function component(options) {
3535
});
3636
}
3737

38-
export default { xml, jid, component };
38+
export { xml, jid, component };

packages/resolve/lib/http.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
2-
// FIXME
3-
// const fetch = globalThis.fetch || import("node-fetch");
4-
51
import parse from "@xmpp/xml/lib/parse.js";
62
import { compare as compareAltConnections } from "./alt-connections.js";
73

8-
export function resolve(domain) {
9-
// eslint-disable-next-line n/no-unsupported-features/node-builtins
10-
return globalThis
11-
.fetch(`https://${domain}/.well-known/host-meta`)
4+
export async function resolve(domain) {
5+
// eslint-disable-next-line n/no-unsupported-features/node-builtins, unicorn/no-await-expression-member
6+
const fetch = globalThis.fetch || (await import("node-fetch")).default;
7+
8+
return fetch(`https://${domain}/.well-known/host-meta`)
129
.then((res) => res.text())
1310
.then((res) => {
1411
return parse(res)

server/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import net from "net";
77
import { promise, delay } from "@xmpp/events";
88
import selfsigned from "selfsigned";
99

10+
// const __dirname = import.meta.dirname;
11+
1012
const readFile = promisify(fs.readFile);
1113
const exec = promisify(child_process.exec);
1214
const removeFile = promisify(fs.unlink);
@@ -116,7 +118,7 @@ async function restart(signal) {
116118
return _start();
117119
}
118120

119-
export {
121+
export default {
120122
isPortOpen,
121123
waitPortClose,
122124
waitPortOpen,

test/component.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ const options = { password, service, domain };
99

1010
let xmpp;
1111

12-
beforeEach(() => {
12+
beforeEach(async () => {
1313
xmpp = component(options);
1414
debug(xmpp);
15-
return server.restart();
15+
await server.restart();
1616
});
1717

1818
afterEach(async () => {

0 commit comments

Comments
 (0)