Files
shields/lib/token-provider.spec.js
T
greenkeeper[bot]andPaul Melnikow 6462cc49d5 Update eslint-plugin-node to the latest version 🚀 (#1786)
* chore(package): update eslint-plugin-node to version 7.0.0

* Update lockfile

* Update call to deprecated API
2018-07-18 18:36:54 -07:00

20 lines
634 B
JavaScript

'use strict';
const assert = require('assert');
const { PoolingTokenProvider } = require('./token-provider');
const isValidGithubToken = require('./github-auth/is-valid-token')
describe('The token provider', function () {
describe('toNative', function () {
it('should return the expected value', function () {
const tokens = ['1', '2', '3', '4', '5'].map(c => c.repeat(40));
const provider = new PoolingTokenProvider(isValidGithubToken);
tokens.forEach(t => provider.addToken(t));
assert.deepStrictEqual(
provider.toNative().sort(),
Array.from(tokens).sort()
);
});
});
});