Explorar o código

Added additional test for `domainLock` template

sanex3339 %!s(int64=4) %!d(string=hai) anos
pai
achega
27a9e18a46

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/index.cli.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/index.js


+ 30 - 0
test/functional-tests/custom-code-helpers/domain-lock/templates/DomainLockNodeTemplate.spec.ts

@@ -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', () => {

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio