Skip to content

Commit

Permalink
Merge pull request #53 from hildjj/remove-mock-dns-server
Browse files Browse the repository at this point in the history
Pull mock-dns-server out into separate package
  • Loading branch information
hildjj authored Sep 5, 2024
2 parents 9ca34c7 + 0b431ed commit 2301a3c
Show file tree
Hide file tree
Showing 12 changed files with 171 additions and 363 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"eslint-plugin-jsdoc": "^50.2.2",
"eslint-plugin-markdown": "5.1.0",
"eslint-plugin-node": "^11.1.0",
"mock-dns-server": "0.0.3",
"typedoc": "0.26.6"
},
"packageManager": "[email protected]",
Expand Down
4 changes: 2 additions & 2 deletions pkg/dohdec-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
"dohdec": "link:../dohdec"
},
"devDependencies": {
"@types/node": "^22.5.3",
"@types/node": "^22.5.4",
"jsrsasign": "^11.1.0",
"minami": "^1.2.3",
"mock-dns-server": "link:../mock-dns-server",
"mock-dns-server": "0.0.3",
"nock": "^13.5.5",
"typescript": "^5.5.4"
},
Expand Down
3 changes: 2 additions & 1 deletion pkg/dohdec-cli/test/cli.ava.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {Buf, prepNock} from '../../../test/utils.js';
import {createServer, plainConnect} from 'mock-dns-server';
import {DNS} from '../../../test/zones.js';
import {DnsCli} from '../lib/cli.js';
import nock from 'nock';
import stream from 'node:stream';
Expand All @@ -9,7 +10,7 @@ prepNock(test, nock, import.meta.url);
let mockServer = null;

test.before(() => {
mockServer = createServer();
mockServer = createServer({zones: DNS});
});

test.after.always(() => new Promise((resolve, reject) => {
Expand Down
4 changes: 2 additions & 2 deletions pkg/dohdec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"nofilter": "^5.0.0"
},
"devDependencies": {
"@types/node": "^22.5.3",
"mock-dns-server": "link:../mock-dns-server",
"@types/node": "^22.5.4",
"mock-dns-server": "0.0.3",
"nock": "^13.5.5",
"typescript": "^5.5.4"
},
Expand Down
5 changes: 3 additions & 2 deletions pkg/dohdec/test/dot.ava.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import {createServer, plainConnect} from 'mock-dns-server';
import {Buffer} from 'node:buffer';
import {DNS} from '../../../test/zones.js';
import {DNSoverTLS} from '../lib/dot.js';
import crypto from 'node:crypto';
import test from 'ava';

let mockServer = null;

test.before(() => {
mockServer = createServer();
mockServer = createServer({zones: DNS});
});

test.after.always(() => new Promise((resolve, reject) => {
Expand Down Expand Up @@ -40,7 +41,7 @@ test('lookup', async t => {
const [{name, type, data}] = res.answers;
t.is(name, 'ietf.org');
t.is(type, 'A');
t.is(data, '4.31.198.44');
t.is(data, '104.16.44.99');
const srv = await dot.lookup('_xmpp-server._tcp.jabber.org', 'srv');
t.deepEqual(srv.answers[0].data, {
port: 5269,
Expand Down
19 changes: 0 additions & 19 deletions pkg/mock-dns-server/LICENSE.md

This file was deleted.

147 changes: 0 additions & 147 deletions pkg/mock-dns-server/index.js

This file was deleted.

39 changes: 0 additions & 39 deletions pkg/mock-dns-server/package.json

This file was deleted.

83 changes: 0 additions & 83 deletions pkg/mock-dns-server/test/server.ava.js

This file was deleted.

17 changes: 0 additions & 17 deletions pkg/mock-dns-server/tsconfig.json

This file was deleted.

Loading

0 comments on commit 2301a3c

Please sign in to comment.