-
Notifications
You must be signed in to change notification settings - Fork 235
Expand file tree
/
Copy pathAuthenticationHandlerOptions.ts
More file actions
27 lines (23 loc) · 1.27 KB
/
AuthenticationHandlerOptions.ts
File metadata and controls
27 lines (23 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
* -------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License.
* See License in the project root for license information.
* -------------------------------------------------------------------------------------------
*/
import { assert } from "chai";
import { AuthenticationHandlerOptions } from "../../../src/middleware/options/AuthenticationHandlerOptions";
import { DummyAuthenticationProvider } from "../../DummyAuthenticationProvider";
describe("AuthenticationHandlerOptions.ts", () => {
const dummyAuthProvider = new DummyAuthenticationProvider();
const authOptions = { scopes: ["test"] };
it("Should create an instance with all the given options", () => {
const options = new AuthenticationHandlerOptions(dummyAuthProvider, authOptions);
assert.equal(options.authenticationProvider, dummyAuthProvider);
assert.equal(options.authenticationProviderOptions, authOptions);
});
it("Should be undefined value if no value is passed", () => {
const options = new AuthenticationHandlerOptions(undefined, authOptions);
assert.isUndefined(options.authenticationProvider);
assert.equal(options.authenticationProviderOptions, authOptions);
});
});