1 const PROJECT_DIR=process.env.PROJECT_DIR;require(`${PROJECT_DIR}/lib/jake`);let{Namespace:Namespace}=require(`${PROJECT_DIR}/lib/namespace`);require("./jakefile");let assert=require("assert");suite("namespace",(function(){this.timeout(7e3),test("resolve namespace by relative name",(function(){let e,a,s;e=namespace("aaa",(function(){a=namespace("bbb",(function(){s=namespace("ccc",(function(){}))}))})),assert.ok(e,Namespace.ROOT_NAMESPACE.resolveNamespace("aaa")),assert.ok(a===e.resolveNamespace("bbb")),assert.ok(s===e.resolveNamespace("bbb:ccc"))})),test("resolve task in sub-namespace by relative path",(function(){let e=Namespace.ROOT_NAMESPACE.resolveNamespace("zooby").resolveTask("frang:w00t:bar");assert.ok(e.action.toString().indexOf("zooby:frang:w00t:bar")>-1)})),test("prefer local to top-level",(function(){let e=Namespace.ROOT_NAMESPACE.resolveNamespace("zooby:frang:w00t").resolveTask("bar");assert.ok(e.action.toString().indexOf("zooby:frang:w00t:bar")>-1)})),test("does resolve top-level",(function(){let e=Namespace.ROOT_NAMESPACE.resolveNamespace("zooby:frang:w00t").resolveTask("foo");assert.ok(e.action.toString().indexOf("top-level foo")>-1)})),test("absolute lookup works from sub-namespaces",(function(){let e=Namespace.ROOT_NAMESPACE.resolveNamespace("hurr:durr").resolveTask("zooby:frang:w00t:bar");assert.ok(e.action.toString().indexOf("zooby:frang:w00t:bar")>-1)})),test("resolution miss with throw error",(function(){let e=Namespace.ROOT_NAMESPACE.resolveTask("asdf:qwer");assert.ok(!e)}))}));