@bigtest/agent
Advanced tools
Comparing version 0.1.0-b8351bf to 0.1.0-ee7a9a5
@@ -1,2 +0,2 @@ | ||
import*as t from"express";import{join as r}from"path";class e{constructor(t){this.url=t}static create(t){if(t.externalURL)return new e(t.externalURL);if(!t.port)throw new Error("An agent server must be created with either an external url or a port number");return new n(t.port)}connectURL(t){return this.url+"/?connectTo="+encodeURIComponent(t)}get harnessScriptURL(){return this.url+"/harness.js"}*listen(){}*join(){yield}}class n extends e{constructor(t){super("http://localhost:"+t),this.port=t}*listen(){var e=r(__dirname,"app"),n=t,o=n().use(n.static(e)),i=yield function(t,r){return e=>{var{resume:n,fail:s}=e,o=t.listen(r,t=>{t?s(t):n(o)})}}(o,this.port);this.http=i,(yield s).ensure(()=>i.close())}join(){return t=>{var{resume:r,ensure:e}=t;if(!this.http)throw new Error("cannot join a server that is not already listening");this.http.on("close",r),e(()=>this.http.off("close",r))}}}var s=t=>{var{resume:r,context:{parent:e}}=t;return r(e.parent)};export{e as AgentServer}; | ||
import*as t from"express";import{join as r}from"path";class e{constructor(t,r){this.url=t,this.appDir=r}static create(t,s){if(void 0===s&&(s=r(__dirname,"app")),t.externalURL)return new e(t.externalURL,s);if(!t.port)throw new Error("An agent server must be created with either an external url or a port number");return new n(t.port,s)}connectURL(t){return this.url+"/?connectTo="+encodeURIComponent(t)}get harnessScriptURL(){return this.url+"/harness.js"}*listen(){}*join(){yield}}class n extends e{constructor(t,r){super("http://localhost:"+t,r),this.port=t}*listen(){var r=t,e=r().use(r.static(this.appDir)),n=yield function(t,r){return e=>{var{resume:n,fail:s}=e,o=t.listen(r,t=>{t?s(t):n(o)})}}(e,this.port);this.http=n,(yield s).ensure(()=>n.close())}join(){return t=>{var{resume:r,ensure:e}=t;if(!this.http)throw new Error("cannot join a server that is not already listening");this.http.on("close",r),e(()=>this.http.off("close",r))}}}var s=t=>{var{resume:r,context:{parent:e}}=t;return r(e.parent)};export{e as AgentServer}; | ||
//# sourceMappingURL=agent.esm.js.map |
@@ -1,2 +0,2 @@ | ||
import*as t from"express";import{join as r}from"path";class e{constructor(t){this.url=t}static create(t){if(t.externalURL)return new e(t.externalURL);if(!t.port)throw new Error("An agent server must be created with either an external url or a port number");return new n(t.port)}connectURL(t){return this.url+"/?connectTo="+encodeURIComponent(t)}get harnessScriptURL(){return this.url+"/harness.js"}*listen(){}*join(){yield}}class n extends e{constructor(t){super("http://localhost:"+t),this.port=t}*listen(){var e=r(__dirname,"app"),n=t,o=n().use(n.static(e)),i=yield function(t,r){return e=>{var{resume:n,fail:s}=e,o=t.listen(r,t=>{t?s(t):n(o)})}}(o,this.port);this.http=i,(yield s).ensure(()=>i.close())}join(){return t=>{var{resume:r,ensure:e}=t;if(!this.http)throw new Error("cannot join a server that is not already listening");this.http.on("close",r),e(()=>this.http.off("close",r))}}}var s=t=>{var{resume:r,context:{parent:e}}=t;return r(e.parent)};export{e as AgentServer}; | ||
import*as t from"express";import{join as r}from"path";class e{constructor(t,r){this.url=t,this.appDir=r}static create(t,s){if(void 0===s&&(s=r(__dirname,"app")),t.externalURL)return new e(t.externalURL,s);if(!t.port)throw new Error("An agent server must be created with either an external url or a port number");return new n(t.port,s)}connectURL(t){return this.url+"/?connectTo="+encodeURIComponent(t)}get harnessScriptURL(){return this.url+"/harness.js"}*listen(){}*join(){yield}}class n extends e{constructor(t,r){super("http://localhost:"+t,r),this.port=t}*listen(){var r=t,e=r().use(r.static(this.appDir)),n=yield function(t,r){return e=>{var{resume:n,fail:s}=e,o=t.listen(r,t=>{t?s(t):n(o)})}}(e,this.port);this.http=n,(yield s).ensure(()=>n.close())}join(){return t=>{var{resume:r,ensure:e}=t;if(!this.http)throw new Error("cannot join a server that is not already listening");this.http.on("close",r),e(()=>this.http.off("close",r))}}}var s=t=>{var{resume:r,context:{parent:e}}=t;return r(e.parent)};export{e as AgentServer}; | ||
//# sourceMappingURL=agent.modern.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("express"),require("path")):"function"==typeof define&&define.amd?define(["exports","express","path"],t):t((e=e||self).agent={},e.express,e.path)}(this,function(e,t,r){class n{constructor(e){this.url=e}static create(e){if(e.externalURL)return new n(e.externalURL);if(!e.port)throw new Error("An agent server must be created with either an external url or a port number");return new s(e.port)}connectURL(e){return this.url+"/?connectTo="+encodeURIComponent(e)}get harnessScriptURL(){return this.url+"/harness.js"}*listen(){}*join(){yield}}class s extends n{constructor(e){super("http://localhost:"+e),this.port=e}*listen(){var e=r.join(__dirname,"app"),n=t,s=n().use(n.static(e)),i=yield function(e,t){return r=>{var{resume:n,fail:s}=r,o=e.listen(t,e=>{e?s(e):n(o)})}}(s,this.port);this.http=i,(yield o).ensure(()=>i.close())}join(){return e=>{var{resume:t,ensure:r}=e;if(!this.http)throw new Error("cannot join a server that is not already listening");this.http.on("close",t),r(()=>this.http.off("close",t))}}}var o=e=>{var{resume:t,context:{parent:r}}=e;return t(r.parent)};e.AgentServer=n}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("express"),require("path")):"function"==typeof define&&define.amd?define(["exports","express","path"],t):t((e=e||self).agent={},e.express,e.path)}(this,function(e,t,r){class n{constructor(e,t){this.url=e,this.appDir=t}static create(e,t){if(void 0===t&&(t=r.join(__dirname,"app")),e.externalURL)return new n(e.externalURL,t);if(!e.port)throw new Error("An agent server must be created with either an external url or a port number");return new s(e.port,t)}connectURL(e){return this.url+"/?connectTo="+encodeURIComponent(e)}get harnessScriptURL(){return this.url+"/harness.js"}*listen(){}*join(){yield}}class s extends n{constructor(e,t){super("http://localhost:"+e,t),this.port=e}*listen(){var e=t,r=e().use(e.static(this.appDir)),n=yield function(e,t){return r=>{var{resume:n,fail:s}=r,i=e.listen(t,e=>{e?s(e):n(i)})}}(r,this.port);this.http=n,(yield i).ensure(()=>n.close())}join(){return e=>{var{resume:t,ensure:r}=e;if(!this.http)throw new Error("cannot join a server that is not already listening");this.http.on("close",t),r(()=>this.http.off("close",t))}}}var i=e=>{var{resume:t,context:{parent:r}}=e;return t(r.parent)};e.AgentServer=n}); | ||
//# sourceMappingURL=agent.umd.js.map |
@@ -8,4 +8,5 @@ import { Operation } from 'effection'; | ||
url: string; | ||
protected constructor(url: string); | ||
static create(options: Options): AgentServer; | ||
protected appDir: string; | ||
protected constructor(url: string, appDir: string); | ||
static create(options: Options, appDir?: string): AgentServer; | ||
connectURL(connectBackURL: string): string; | ||
@@ -12,0 +13,0 @@ get harnessScriptURL(): string; |
{ | ||
"name": "@bigtest/agent", | ||
"version": "0.1.0-b8351bf", | ||
"version": "0.1.0-ee7a9a5", | ||
"description": "Agent for connecting test environments (browsers) to BigTest", | ||
@@ -16,6 +16,5 @@ "main": "dist/agent.umd.js", | ||
"scripts": { | ||
"lint": "eslint 'src/**/*.ts' 'bin/**/*.ts'", | ||
"lint": "eslint '**/*.ts'", | ||
"test": "mocha -r ts-node/register test/**/*.test.ts", | ||
"start": "ts-node bin/start.ts", | ||
"build": "echo 'build'", | ||
"bundle": "parcel watch --out-dir dist/app app/index.html", | ||
@@ -22,0 +21,0 @@ "prepack": "microbundle --entry index.ts --output dist --format modern,es,umd && parcel build --out-dir dist/app app/index.html app/harness.ts" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
99436
153