This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* eslint-env mocha */ | ||
'use strict' | ||
|
||
const expect = require('chai').expect | ||
const runOnAndOff = require('../utils/on-and-off') | ||
|
||
describe('dns', () => runOnAndOff((thing) => { | ||
let ipfs | ||
|
||
before(function () { | ||
this.timeout(60 * 1000) | ||
ipfs = thing.ipfs | ||
}) | ||
|
||
it('dns record for ipfs.io', function () { | ||
this.timeout(60 * 1000) | ||
|
||
return ipfs('ipfs.io').then((res) => { | ||
expect(res.substr(0, 6)).to.eql('/ipfs/') | ||
}) | ||
}) | ||
})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* eslint-env mocha */ | ||
'use strict' | ||
|
||
const chai = require('chai') | ||
const dirtyChai = require('dirty-chai') | ||
const expect = chai.expect | ||
chai.use(dirtyChai) | ||
|
||
module.exports = (ctl) => { | ||
describe('.dns', () => { | ||
it('get dns for ipfs.io', (done) => { | ||
ctl.dns('ipfs.io', (err, result) => { | ||
expect(err).to.not.exist() | ||
expect(result).to.exist() | ||
done() | ||
}) | ||
}) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* eslint-env mocha */ | ||
'use strict' | ||
|
||
const expect = require('chai').expect | ||
|
||
module.exports = (http) => { | ||
describe('/dns', () => { | ||
let api | ||
|
||
before(() => { | ||
api = http.api.server.select('API') | ||
}) | ||
|
||
it('get the id', (done) => { | ||
api.inject({ | ||
method: 'GET', | ||
url: '/api/v0/dns?arg=ipfs.io' | ||
}, (res) => { | ||
expect(res).to.have.property('Path') | ||
done() | ||
}) | ||
}) | ||
}) | ||
} |