Fix validator test

This commit is contained in:
AkiraFukushima 2018-07-28 21:49:06 +09:00
parent 42a86820a9
commit de9d76c48a
1 changed files with 7 additions and 7 deletions

View File

@ -7,49 +7,49 @@ describe('validator', () => {
const domain = 'https://mastodon.social'
it('should not match', () => {
const res = domain.search(domainFormat)
assert.equal(res, -1)
assert.strictEqual(res, -1)
})
})
context('string contains account name', () => {
const domain = 'h3_poteto@mastodon.social'
it('should not match', () => {
const res = domain.search(domainFormat)
assert.equal(res, -1)
assert.strictEqual(res, -1)
})
})
context('string is gTLD domain', () => {
const domain = 'mastodon.social'
it('should match', () => {
const res = domain.search(domainFormat)
assert.equal(res, 0)
assert.strictEqual(res, 0)
})
})
context('string is subdomain', () => {
const domain = 'music.mastodon.social'
it('should match', () => {
const res = domain.search(domainFormat)
assert.equal(res, 0)
assert.strictEqual(res, 0)
})
})
context('string is subdomain', () => {
const domain = 'social.tchncs.de'
it('should match', () => {
const res = domain.search(domainFormat)
assert.equal(res, 0)
assert.strictEqual(res, 0)
})
})
context('string is jp domain', () => {
const domain = 'mstdn.co.jp'
it('should match', () => {
const res = domain.search(domainFormat)
assert.equal(res, 0)
assert.strictEqual(res, 0)
})
})
context('string contains hyphone', () => {
const domain = 'music-mastodon.social'
it('should match', () => {
const res = domain.search(domainFormat)
assert.equal(res, 0)
assert.strictEqual(res, 0)
})
})
})