mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-26 08:08:54 +00:00
chore(tests): check node version before running decipher tests
This commit is contained in:
@@ -82,17 +82,20 @@ describe('YouTube.js Tests', () => {
|
||||
}, 30000);
|
||||
});
|
||||
|
||||
describe('Deciphers', () => {
|
||||
it('Should decipher signature', () => {
|
||||
const result = Signature.fromSourceCode(Constants.DECIPHERS.SIG.ALGORITHM).decipher(Constants.DECIPHERS.SIG.ORIGINAL_URL);
|
||||
expect(result).toEqual(Constants.DECIPHERS.SIG.DECIPHERED_URL);
|
||||
});
|
||||
// Run decipher tests only on newer versions of node since we're requiring them directly.
|
||||
if (process.version.match(/^v(\d+\.\d+)/)[1] > 12) {
|
||||
describe('Deciphers', () => {
|
||||
it('Should decipher signature', () => {
|
||||
const result = Signature.fromSourceCode(Constants.DECIPHERS.SIG.ALGORITHM).decipher(Constants.DECIPHERS.SIG.ORIGINAL_URL);
|
||||
expect(result).toEqual(Constants.DECIPHERS.SIG.DECIPHERED_URL);
|
||||
});
|
||||
|
||||
it('Should decipher ntoken', () => {
|
||||
const result = NToken.fromSourceCode(Constants.DECIPHERS.N.ALGORITHM).transform(Constants.DECIPHERS.N.ORIGINAL_TOKEN);
|
||||
expect(result).toEqual(Constants.DECIPHERS.N.DECIPHERED_TOKEN);
|
||||
it('Should decipher ntoken', () => {
|
||||
const result = NToken.fromSourceCode(Constants.DECIPHERS.N.ALGORITHM).transform(Constants.DECIPHERS.N.ORIGINAL_TOKEN);
|
||||
expect(result).toEqual(Constants.DECIPHERS.N.DECIPHERED_TOKEN);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function download(id, session) {
|
||||
|
||||
Reference in New Issue
Block a user