Skip to content

Commit

Permalink
Merge pull request #1393 from AzureAD/e2e-test-framework
Browse files Browse the repository at this point in the history
End to End test framework for MSAL 1.0 and 2.0
  • Loading branch information
Prithvi Kanherkar committed Mar 30, 2020
2 parents 2fce441 + a64fdfa commit fa65148
Show file tree
Hide file tree
Showing 46 changed files with 6,376 additions and 1,362 deletions.
12 changes: 12 additions & 0 deletions build/npm-build-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,36 @@ steps:
displayName: 'Install Node.js'

- task: Npm@1
displayName: 'npm ci'
inputs:
command: 'custom'
customCommand: 'ci'
verbose: true

- task: Npm@1
displayName: 'Build Packages'
inputs:
command: 'custom'
customCommand: 'run build'

- task: Npm@1
displayName: 'Unit Tests'
inputs:
command: 'custom'
customCommand: 'run test:coverage'

- task: Npm@1
displayName: 'Code Coverage Reporting'
env:
COVERALLS_REPO_TOKEN: $(COVERALLS_REPO_TOKEN)
inputs:
command: 'custom'
customCommand: 'run test:report'

- task: Npm@1
displayName: 'End-to-End Tests'
env:
AZURE_CLIENT_SECRET: $(AZURE_CLIENT_SECRET)
inputs:
command: 'custom'
customCommand: 'run test:e2e'
25 changes: 25 additions & 0 deletions build/postinstall.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
let exec = require("child_process").exec;

if (parseInt(process.env.RUNNING_NODE_CI)) {
console.log("Running scoped bootstrap");
exec("lerna --scope @azure/* --scope msal --scope vanilla-js-test* --ignore @azure/msal-angularjs bootstrap", function (error, stdout, stderr) {
if (stdout) {
console.log('stdout' + stdout);
}
console.error('stderr: ' + stderr);
if (error !== null) {
console.log('exec error: ' + error);
}
});
} else {
console.log("Running full bootstrap");
exec("lerna bootstrap", function (error, stdout, stderr) {
if (stdout) {
console.log('stdout' + stdout);
}
console.error('stderr: ' + stderr);
if (error !== null) {
console.log('exec error: ' + error);
}
});
}
9 changes: 8 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
"lerna": "3.16.4",
"command": {
"run": {
"scope": ["msal", "@azure/msal-common", "@azure/msal-browser", "@azure/msal-angular"]
"scope": [
"msal",
"@azure/msal-common",
"@azure/msal-browser",
"@azure/msal-angular",
"vanilla-js-test-app",
"vanilla-js-test-app-2.0"
]
}
},
"packages": [
Expand Down
12 changes: 7 additions & 5 deletions lib/msal-browser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,15 @@ If you have MSAL v1.x currently running in your application, you can follow the

## Samples

The [`samples`](../samples) folder contains samples applications for our libraries. Here is a complete list of samples for the MSAL.js 2.x library:
The [`VanillaJSTestApp2.0` folder](../samples/VanillaJSTestApp2.0) contains sample applications for our libraries. You can run any sample by changing the `authConfig.js` file in the respective folder to match your app registration and running the `npm` command `npm start -- -s <sample-name> -p <port>`.

| Sample | Description |
| ------ | ----------- |
| [Vanilla JS Sample](../../samples/VanillaJSTestApp2.0) | A vanilla Javascript sample showing basic usage of the MSAL 2.0 library (`msal-browser` package) with the Microsoft Graph API. |
Here is a complete list of samples for the MSAL.js 2.x library:

Instructions to run the samples can be found in the respective READMEs.
| Sample | Description | How to Run |
| ------ | ----------- | ---------- |
| [Basic Auth Sample](../../samples/VanillaJSTestApp2.0/default) | A vanilla Javascript sample showing basic usage of the MSAL 2.0 library (`msal-browser` package) with the Microsoft Graph API. | `npm start -- -s default` |

More instructions to run the sample can be found in the [`README.md` file](../samples/VanillaJSTestApp2.0/README.md) of the VanillaJSTestApp2.0 folder.

## Build and Test

Expand Down
2 changes: 1 addition & 1 deletion lib/msal-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ If you would like to skip a cached token and go to the server, please pass in th
## Usage
The example below walks you through how to login a user and acquire a token to be used for Microsoft's Graph Api.

#### Prerequisite
#### Prerequisites

Before using MSAL.js you will need to [register an application in Azure AD](https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app) to get a valid `clientId` for configuration, and to register the routes that your app will accept redirect traffic on.

Expand Down
177 changes: 0 additions & 177 deletions lib/msal-core/oldTests/Authority.spec.ts

This file was deleted.

0 comments on commit fa65148

Please sign in to comment.