We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7631e9e commit 9d16d66Copy full SHA for 9d16d66
test/index.coffee
@@ -83,6 +83,27 @@ describe 'Connecting', ->
83
done err, val
84
85
86
+describe 'Basic auth', ->
87
+
88
+ it 'should support basic auth', (done) ->
89
+ auth =
90
+ user: "username"
91
+ pass: "password"
92
+ etcd = new Etcd "localhost:4001", { auth: auth }
93
94
+ m = nock("http://localhost:4001")
95
+ .get("/v2/keys/key")
96
+ .basicAuth(
97
+ user: "username",
98
99
+ )
100
+ .reply(200)
101
102
+ etcd.get 'key', (err, val) ->
103
+ m.isDone().should.be.true
104
+ done err, val
105
106
107
describe 'Basic functions', ->
108
109
etcd = new Etcd
0 commit comments