mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-28 00:56:23 +00:00
fix(tests): require deciphers only when needed
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user