mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
Added additional test for domainLock template
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+30
@@ -461,6 +461,36 @@ describe('DomainLockTemplate', () => {
|
||||
assert.throws(testFunc);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Variant #4', () => {
|
||||
const domainsString: string = ['example.com'].join(';');
|
||||
const currentDomain: string = 'sub.example.com';
|
||||
|
||||
let testFunc: () => void;
|
||||
|
||||
before(() => {
|
||||
const [
|
||||
hiddenDomainsString,
|
||||
diff
|
||||
] = cryptUtils.hideString(domainsString, domainsString.length * 3);
|
||||
|
||||
testFunc = () => getFunctionFromTemplate(
|
||||
{
|
||||
domainLockFunctionName: 'domainLockFunction',
|
||||
diff: diff,
|
||||
domains: hiddenDomainsString,
|
||||
globalVariableTemplate: GlobalVariableTemplate1(),
|
||||
singleCallControllerFunctionName
|
||||
},
|
||||
singleCallControllerFunctionName,
|
||||
getDocumentDomainTemplate(currentDomain)
|
||||
);
|
||||
});
|
||||
|
||||
it('should throw an error', () => {
|
||||
assert.throws(testFunc);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('Variant #7: location.hostname', () => {
|
||||
|
||||
Reference in New Issue
Block a user