Skip to content

Commit

Permalink
feat(#5): few tokens too
Browse files Browse the repository at this point in the history
  • Loading branch information
h1alexbel committed May 22, 2024
1 parent 846897e commit 1ce5fbc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions test/resources/tokens.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
theFirstToken
theSecondToken
someOtherToken
11 changes: 10 additions & 1 deletion test/tokens.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,21 @@ const tokens = require('../src/tokens.js');

describe('Test case for tokens.js', function() {
it('fetches one token from file', function() {
const fetched = tokens("test/resources/one");
const fetched = tokens('test/resources/one');
const expected = 'justOneToken';
assert.equal(
fetched,
expected,
`fetched tokens ${fetched} don't match with expected ${expected}`
)
});
it('fetches a few tokens from file', function() {
const fetched = tokens('test/resources/tokens.txt');
const expected = ['theFirstToken', 'theSecondToken', 'someOtherToken'];
assert.deepEqual(
fetched,
expected,
`fetched tokens ${fetched} don't match with expected ${expected}`
)
});
});

0 comments on commit 1ce5fbc

Please sign in to comment.