From ed2178b6527ce46e0976b53c0e2656775b8e618e Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Sat, 24 Oct 2020 01:25:21 +0200 Subject: [PATCH] Improve serviceproviders.test --- test/serviceproviders.test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/serviceproviders.test.js b/test/serviceproviders.test.js index 11a423a..8b5349a 100644 --- a/test/serviceproviders.test.js +++ b/test/serviceproviders.test.js @@ -32,7 +32,7 @@ const assert = require('chai').assert const request = require('supertest') const doipjs = require('../src') -for (let sp in doipjs.serviceproviders) { +doipjs.serviceprovidersList.forEach((sp, i) => { describe(`serviceproviders.${sp}`, () => { it('should be an object', () => { expect(doipjs.serviceproviders[sp]).to.be.a('object') @@ -48,7 +48,7 @@ for (let sp in doipjs.serviceproviders) { expect(doipjs.serviceproviders[sp].tests).to.be.instanceof(Array) }) - doipjs.serviceproviders[sp].tests.forEach((test, i) => { + doipjs.serviceproviders[sp].tests.forEach((test, j) => { if (test.shouldMatch) { it(`should match "${test.url}"`, () => { expect(doipjs.serviceproviders[sp].reURL.test(test.url)).to.be.true @@ -58,7 +58,7 @@ for (let sp in doipjs.serviceproviders) { expect(doipjs.serviceproviders[sp].reURL.test(test.url)).to.be.false }) } - }); + }) }) -} +})