-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
11c9896
commit 4bf1f76
Showing
6 changed files
with
68 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
'use strict'; | ||
|
||
const assert = require('assert'); | ||
const request = require('supertest'); | ||
const config = require('./fixtures/simple-config/webpack.config'); | ||
const helper = require('./helper'); | ||
|
||
describe('socket options', () => { | ||
let server; | ||
let req; | ||
|
||
afterEach((done) => { | ||
helper.close(done); | ||
req = null; | ||
server = null; | ||
}); | ||
describe('default behavior', () => { | ||
beforeEach((done) => { | ||
server = helper.start(config, {}, done); | ||
req = request('http://localhost:8080'); | ||
}); | ||
|
||
it('defaults to a path', () => { | ||
assert.ok(server.sockPath.match(/\/[a-z0-9\-/]+[^/]$/)); | ||
}); | ||
|
||
it('responds with a 200', (done) => { | ||
req.get('/sockjs-node').expect(200, done); | ||
}); | ||
}); | ||
|
||
describe('socksPath option', () => { | ||
const path = '/foo/test/bar'; | ||
beforeEach((done) => { | ||
server = helper.start(config, { | ||
sockPath: '/foo/test/bar/' | ||
}, done); | ||
req = request('http://localhost:8080'); | ||
}); | ||
|
||
it('sets the sock path correctly and strips leading and trailing /s', () => { | ||
assert.equal(server.sockPath, path); | ||
}); | ||
|
||
it('responds with a 200 second', (done) => { | ||
req.get(path).expect(200, done); | ||
}); | ||
}); | ||
}); |
4bf1f76
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 please release this soon it will save the day!
4bf1f76
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ebrentnelson near future (tomorrow i think)