mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
feat(api): add node:test (#48437)
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
f7644bec68
commit
37ed23ef38
+2
-1
@@ -33,8 +33,9 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc index.ts",
|
||||
"develop": "nodemon index.ts",
|
||||
"start": "NODE_ENV=production node index.js",
|
||||
"develop": "nodemon index.ts"
|
||||
"test": "NODE_OPTIONS='--test-only' ts-node **/*.test.ts"
|
||||
},
|
||||
"version": "0.0.1"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
import assert from 'node:assert';
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
import { describe, it } from 'node:test';
|
||||
import { base64URLEncode, challenge, verifier } from '.';
|
||||
|
||||
describe('utils', { only: true }, () => {
|
||||
it('base64URLEncode', () => {
|
||||
assert.strictEqual(base64URLEncode(Buffer.from('test')), 'dGVzdA');
|
||||
});
|
||||
it('verifier', () => {
|
||||
const v = verifier;
|
||||
assert.strictEqual(v.length, 43);
|
||||
});
|
||||
it('challenge', () => {
|
||||
const c = challenge;
|
||||
assert.strictEqual(c.length, 43);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user