Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit tests restructuring #370

Merged
merged 12 commits into from
Jan 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,11 @@ npm-debug.log
/lib/*
!/lib/.npmignore

src/**/*.js
src/**/*.js.map
src/**/*.d.ts

samples/node/secrets.json
samples/browser/src/secrets.js
samples/browser/src/graph-js-sdk.js
samples/browser/src/graph-es-sdk.js

spec/**/*.js
spec/**/*.d.ts
spec/**/*.js.map
spec/**/secrets.ts
test/development/secrets.ts

.nyc_output/*
6 changes: 3 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ src/**/*.js
src/**/*.js.map
src/**/*.d.ts

spec/**/*.js
spec/**/*.js.map
spec/**/*.d.ts
test/**/*.js
test/**/*.js.map
test/**/*.d.ts
10 changes: 5 additions & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"request": "launch",
"name": "Run Content tests",
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
"args": ["${workspaceRoot}/lib/spec/content/*.js"],
"args": ["${workspaceRoot}/lib/test/common/**/*.js"],
"cwd": "${workspaceRoot}",
"preLaunchTask": "Run Compile",
"outFiles": [],
Expand All @@ -29,7 +29,7 @@
"request": "launch",
"name": "Run Core tests",
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
"args": ["${workspaceRoot}/lib/spec/core/*.js"],
"args": ["${workspaceRoot}/lib/test/common/core/*.js"],
"cwd": "${workspaceRoot}",
"preLaunchTask": "Run Compile",
"outFiles": [],
Expand All @@ -40,7 +40,7 @@
"request": "launch",
"name": "Run Middleware tests",
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
"args": ["${workspaceRoot}/lib/spec/middleware/*.js"],
"args": ["${workspaceRoot}/lib/test/common/middleware/*.js"],
"cwd": "${workspaceRoot}",
"preLaunchTask": "Run Compile",
"outFiles": [],
Expand All @@ -51,7 +51,7 @@
"request": "launch",
"name": "Run Tasks tests",
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
"args": ["${workspaceRoot}/lib/spec/tasks/*.js"],
"args": ["${workspaceRoot}/lib/test/common/tasks/*.js"],
"cwd": "${workspaceRoot}",
"preLaunchTask": "Run Compile",
"outFiles": [],
Expand All @@ -62,7 +62,7 @@
"request": "launch",
"name": "Run Workload tests",
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
"args": ["${workspaceRoot}/spec/development/workload/*.js"],
"args": ["${workspaceRoot}/test/common/development/workload/*.js"],
"cwd": "${workspaceRoot}",
"preLaunchTask": "Run Compile",
"outFiles": [],
Expand Down
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,9 @@ npm install

To edit files, open them in an editor of your choice and modify them. To create a new file, use the editor of your choice and save the new file in the appropriate location in your local copy of the repository. While working, save your work frequently.

*Note: Make sure to add unit tests to validate you changes.*
_Note: Make sure to add unit tests to validate you changes._

Once you have done with your changes, You have to build and test your changes
To build the library run,
Build and test your changes with the following commands after you have completed your work:

```cmd
npm run build
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ Refer devDependencies in [package.json](./package.json) for the compatible msal
```

```typescript

// Configuration options for MSAL @see https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL.js-1.0.0-api-release#configuration-options
const msalConfig = {
auth: {
Expand Down Expand Up @@ -97,7 +96,7 @@ npm install msal@<version>
import { UserAgentApplication } from "msal";

import { ImplicitMSALAuthenticationProvider } from "@microsoft/microsoft-graph-client/lib/src/ImplicitMSALAuthenticationProvider";
import { MSALAuthenticationProviderOptions } from '@microsoft/microsoft-graph-client/lib/src/MSALAuthenticationProviderOptions';
import { MSALAuthenticationProviderOptions } from "@microsoft/microsoft-graph-client/lib/src/MSALAuthenticationProviderOptions";

// An Optional options for initializing the MSAL @see https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics#configuration-options
const msalConfig = {
Expand Down
13 changes: 13 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = function(config) {
config.set({
frameworks: ["mocha", "chai", "karma-typescript"],
files: ["test/common/**/*.ts", "src/**/*.ts", "test/browser/**/*.ts", "test/*.ts"],
preprocessors: {
"**/*.ts": ["karma-typescript"],
},
karmaTypescriptConfig: {
tsconfig: "./tsconfig-cjs.json",
},
browsers: ["ChromeHeadless"],
});
};
2 changes: 1 addition & 1 deletion lib/.npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.npmignore
spec/
test/
Loading