Skip to content

Commit

Permalink
run linting
Browse files Browse the repository at this point in the history
  • Loading branch information
smhg committed Feb 23, 2023
1 parent 71cee0f commit 755efce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class Options {
constructor () {
this.https = false;
this.host = null;
let port = 35729; // backing variable for port property closure
let port = 35729; // backing variable for port property closure

// we allow port to be overridden with a falsy value to indicate
// that we should not add a port specification to the backend url;
Expand Down
12 changes: 6 additions & 6 deletions test/options_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,26 +139,26 @@ describe('Options', function () {
});

it('should allow the port parameter to be set to blank', function () {
let dom = new JSDOM('<script src="https://somewhere.com/livereload.js?port="></script>');
let options = Options.extract(dom.window.document);
const dom = new JSDOM('<script src="https://somewhere.com/livereload.js?port="></script>');
const options = Options.extract(dom.window.document);

assert.ok(options);
return assert.strictEqual('', options.port);
});

it('should inherit the port parameter from the script URL if blank', function () {
let dom = new JSDOM('<script src="https://somewhere.com:8080/livereload.js?port="></script>');
const dom = new JSDOM('<script src="https://somewhere.com:8080/livereload.js?port="></script>');

let options = Options.extract(dom.window.document);
const options = Options.extract(dom.window.document);
assert.ok(options);

return assert.strictEqual(8080, options.port);
});

it('should propagate arbitrary port number when non-empty', function () {
let dom = new JSDOM('<script src="http://somewhere.com/livereload.js?port=abc"></script>');
const dom = new JSDOM('<script src="http://somewhere.com/livereload.js?port=abc"></script>');

let options = Options.extract(dom.window.document);
const options = Options.extract(dom.window.document);
assert.ok(options);

return assert.strictEqual('abc', options.port);
Expand Down

0 comments on commit 755efce

Please sign in to comment.