fix(tests): require deciphers only when needed

This commit is contained in:
LuanRT
2022-07-07 00:20:48 -03:00
parent d729972251
commit 1837d4929c
2 changed files with 6 additions and 4 deletions

View File

@@ -2,8 +2,6 @@
const Fs = require('fs');
const Innertube = require('../../build/node');
const { default: NToken } = require('../../lib/deciphers/NToken');
const { default: Signature} = require('../../lib/deciphers/Signature');
const Constants = require('../constants');
describe('YouTube.js Tests', () => {
@@ -84,6 +82,9 @@ describe('YouTube.js Tests', () => {
// Run decipher tests only on newer versions of node since we're requiring them directly.
if (process.version.match(/^v(\d+\.\d+)/)[1] > 12) {
const { default: NToken } = require('../../lib/deciphers/NToken');
const { default: Signature} = require('../../lib/deciphers/Signature');
describe('Deciphers', () => {
it('Should decipher signature', () => {
const result = Signature.fromSourceCode(Constants.DECIPHERS.SIG.ALGORITHM).decipher(Constants.DECIPHERS.SIG.ORIGINAL_URL);