Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
f48ed18
updated broken link in README
krototype Aug 16, 2019
8178222
Merge pull request #218 from microsoftgraph/abhsriva/updateREADME
krototype Aug 22, 2019
2ec9a2f
Merge branch 'master' into dev
muthu-rathinam Aug 27, 2019
32daeb8
Post request with empty body, now working fine.
krototype Sep 16, 2019
eed1515
Merge branch 'dev' into abhsriva/emptyPostRequest
krototype Sep 16, 2019
6850658
updated the tests for this case
krototype Sep 16, 2019
f7c333b
Merge branch 'abhsriva/emptyPostRequest' of https://github.com/micros…
krototype Sep 17, 2019
2ebf666
made change to use undefined instead of null as classname
krototype Sep 17, 2019
7baaf98
Merge pull request #229 from microsoftgraph/abhsriva/emptyPostRequest
krototype Oct 3, 2019
834fcf3
added functionality to simplify building middleware chain
krototype Oct 15, 2019
b2f7d3b
Merge branch 'dev' into build_middleware_chain
krototype Oct 15, 2019
de8a55b
Merge pull request #239 from microsoftgraph/build_middleware_chain
krototype Oct 18, 2019
072bed1
Updated GraphRequest.ts for .count() scenario
krototype Oct 22, 2019
b9a66b4
Merge pull request #243 from microsoftgraph/abhsriva/update-count
krototype Oct 25, 2019
c3e0ef3
Bumped version to '2.1.0-Preview.1'
muthu-rathinam Oct 25, 2019
0374959
Adding the Modifying middleware chain samples
krototype Nov 12, 2019
f825b1b
- fixes broken link to client instance
baywet Nov 18, 2019
c4e43a8
Updated the example to the correct return type
Nov 19, 2019
f2b418e
Merge pull request #247 from microsoftgraph/abhsriva/customMiddleware…
krototype Nov 26, 2019
42cf768
Merge branch 'dev' into patch-1
krototype Nov 26, 2019
704d5e3
Merge pull request #250 from baywet/patch-1
krototype Nov 26, 2019
b9a3225
Merge branch 'dev' into patch-1
Nov 27, 2019
73e0b1e
fix casing on filename
gidsg Nov 29, 2019
ea88e47
Merge branch 'dev' into fix-case
muthurathinam Dec 9, 2019
da8d0f3
Merge pull request #251 from warreee/patch-1
muthurathinam Dec 9, 2019
e920fad
Merge branch 'dev' into fix-case
muthurathinam Dec 9, 2019
4a70b05
Merge pull request #255 from gidsg/fix-case
muthurathinam Dec 9, 2019
db7403d
Update package.json
nmetulev Dec 11, 2019
ea5f4ab
Merge pull request #257 from nmetulev/patch-2
muthurathinam Dec 12, 2019
9da92e1
Designed ChaosHandler
krototype Dec 12, 2019
f37b583
Merge pull request #258 from microsoftgraph/abhsriva/ChaosHandler
krototype Dec 12, 2019
aa17391
Removing the set and get middleware chain method
krototype Dec 12, 2019
3b95f44
Merge pull request #259 from microsoftgraph/removeSetMiddleware
krototype Dec 12, 2019
183cf62
Update README
behnammodi Jun 9, 2020
4d59843
Update README
behnammodi Jun 9, 2020
a4d34d6
Merge pull request #290 from behnammodi/dev
ddyett Jun 9, 2020
42ee7aa
Bump lodash from 4.17.15 to 4.17.19 in /samples/browser
dependabot[bot] Jul 16, 2020
870477b
Merge pull request #299 from microsoftgraph/dependabot/npm_and_yarn/s…
ddyett Jul 16, 2020
6e890cc
Changed parsepath and query functions to split query params on first …
nikithauc Jul 28, 2020
6813139
Correcting spelling in comments, setting the param key directlyand re…
nikithauc Jul 29, 2020
72adfd0
Adding a buildheaders function to conditionally set content type and …
nikithauc Jul 29, 2020
b946955
Altering condition to be optimal
nikithauc Jul 29, 2020
d5bb8c4
Adding formdata to the node project, setting the esModuleInterop conf…
nikithauc Aug 4, 2020
6c68a75
Adding a private query parsing function and more validations
nikithauc Aug 4, 2020
4a63220
Adding tests for url parsing and comments to the private url parsing …
nikithauc Aug 5, 2020
35c804d
Adding more information in the return comments for functions returnin…
nikithauc Aug 5, 2020
099fa02
Adding unit test for serializecontent testing if content is null, cha…
nikithauc Aug 5, 2020
1f342bf
Changing the conditional expression to check for undefined or null he…
nikithauc Aug 5, 2020
36b0cc9
Adding the missing return
nikithauc Aug 5, 2020
d8a1ff9
Removing the try catch block from the test case
nikithauc Aug 5, 2020
2b0d381
Removing the try catch block from the test case
nikithauc Aug 5, 2020
ed902ec
Merge pull request #306 from microsoftgraph/JS_Issue_291_URLParsingCo…
MIchaelMainer Aug 7, 2020
45727eb
Returning if the content-type is present else setting content-type as…
nikithauc Aug 7, 2020
cff1a71
Merge branch 'dev' into JS-Issue-293-298-Emptybody-Content-type
nikithauc Aug 7, 2020
3f9412d
Uninstalling formdata, restoring the tsconfigs and removing the condi…
nikithauc Aug 12, 2020
354b215
Merge branch 'JS-Issue-293-298-Emptybody-Content-type' of https://git…
nikithauc Aug 12, 2020
5dd2a1d
Restoring file
nikithauc Aug 12, 2020
62b5f8c
Reverting the package json changes
nikithauc Aug 12, 2020
1ee7bd8
Merge pull request #309 from microsoftgraph/JS-Issue-293-298-Emptybod…
MIchaelMainer Aug 14, 2020
3138966
Bump yargs-parser from 13.1.1 to 13.1.2 in /samples/browser (#321)
dependabot[bot] Sep 9, 2020
9e25f05
Bump mixin-deep from 1.3.1 to 1.3.2 in /scripts (#301)
dependabot[bot] Sep 9, 2020
ab824f7
Bump http-proxy from 1.17.0 to 1.18.1 in /samples/browser (#319)
dependabot[bot] Sep 9, 2020
aaf142e
Update OneDriveLargeFileUploadTask.ts (#325)
hasridha Sep 17, 2020
a2742b3
Use correct class name (#284)
mattdenkers Sep 24, 2020
8089cd0
Typo in documentation example. (#270)
lewgordon Sep 24, 2020
130f3c0
Enhancement/#311 page iterator request options (#318)
nikithauc Sep 25, 2020
bdaf597
Sorting parameter list - chaoshandleroptions (#334)
nikithauc Oct 1, 2020
f99d0ff
Client init with middleware array (#333)
nikithauc Oct 5, 2020
ad4399b
Make GraphError real Error (#335)
OlivierCuyp Oct 5, 2020
a95a762
Using ternary shorthand, upgrade preview 2.1.0-2 (#337)
nikithauc Oct 6, 2020
412b6bf
Bump version to 2.1.0
nikithauc Oct 8, 2020
054db46
merging with master
nikithauc Oct 8, 2020
cd5a6d8
changing.substring parameter, comments to check middleware
nikithauc Oct 8, 2020
3f85c02
adding tests, urlotherqueryoptions type
nikithauc Oct 8, 2020
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Sorting parameter list - chaoshandleroptions (#334)
  • Loading branch information
nikithauc authored Oct 1, 2020
commit bdaf597396c62414fcea6b8f198f08b593d4123c
2 changes: 1 addition & 1 deletion docs/ChaosHandlerSamples.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ client
// OverRiding to Random mode, providing the chaos percentage as 60(percentage times the error would be generated from handler)
client
.api("/me")
.middlewareOptions([new MicrosoftGraph.ChaosHandlerOptions(MicrosoftGraph.ChaosStrategy.RANDOM, undefined, "I generated the error", 60)])
.middlewareOptions([new MicrosoftGraph.ChaosHandlerOptions(MicrosoftGraph.ChaosStrategy.RANDOM, "I generated the error", undefined, 60)])
.get()
.then((res) => {
console.log(res);
Expand Down
2 changes: 1 addition & 1 deletion spec/development/workload/PageIterator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ describe("PageIterator", function() {
return true;
};

const middlewareOptions = [new ChaosHandlerOptions(ChaosStrategy.MANUAL, 200, "middleware options for pageIterator", 0, responseBody)];
const middlewareOptions = [new ChaosHandlerOptions(ChaosStrategy.MANUAL, "middleware options for pageIterator", 200, 0, responseBody)];
const requestOptions = { middlewareOptions };

const client = Client.initWithMiddleware(clientOptions);
Expand Down
12 changes: 6 additions & 6 deletions spec/middleware/ChaosHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe("ChaosHandler.ts", () => {
};

it("Should return a valid response object for MANUAL case", () => {
chaosHandler["createResponse"](new ChaosHandlerOptions(ChaosStrategy.MANUAL, 404), cxt);
chaosHandler["createResponse"](new ChaosHandlerOptions(ChaosStrategy.MANUAL, "Manual response", 404), cxt);
assert.isDefined(cxt.response);
});

Expand Down Expand Up @@ -90,7 +90,7 @@ describe("ChaosHandler.ts", () => {
});

it("Should send the request to the graph", async () => {
handler["sendRequest"](new ChaosHandlerOptions(ChaosStrategy.RANDOM, undefined, "I generated the error", 100), cxt);
handler["sendRequest"](new ChaosHandlerOptions(ChaosStrategy.RANDOM, "I generated the error", undefined, 100), cxt);
assert.isDefined(cxt.response);
});
});
Expand Down Expand Up @@ -143,13 +143,13 @@ describe("ChaosHandler.ts", () => {
const tempChaosHandlerManualRegex = new ChaosHandler(tempManualOptionsRegex, manualMap);

it("Should set a statusCode for MANUAL mode", () => {
const tempOptions = new ChaosHandlerOptions(ChaosStrategy.MANUAL, 404);
const tempOptions = new ChaosHandlerOptions(ChaosStrategy.MANUAL, "Set status code", 404);
chaosHandler["setStatusCode"](tempOptions, "https://graph.microsoft.com/v1.0/me", RequestMethod.GET);
assert.isDefined(tempOptions.statusCode);
});

it("Should set a statusCode for RANDOM mode", () => {
const tempOptions = new ChaosHandlerOptions(ChaosStrategy.RANDOM, undefined, "I generated the error", 100);
const tempOptions = new ChaosHandlerOptions(ChaosStrategy.RANDOM, "I generated the error", undefined, 100);
chaosHandler["setStatusCode"](tempOptions, "https://graph.microsoft.com/v1.0/me", RequestMethod.POST);
assert.isDefined(tempOptions.statusCode);
});
Expand All @@ -167,7 +167,7 @@ describe("ChaosHandler.ts", () => {

describe("getOptions", () => {
it("Should return the options in the context object", () => {
const options = new ChaosHandlerOptions(ChaosStrategy.MANUAL, 405);
const options = new ChaosHandlerOptions(ChaosStrategy.MANUAL, "Get options", 405);
const cxt: Context = {
request: "url",
middlewareControl: new MiddlewareControl([options]),
Expand Down Expand Up @@ -240,7 +240,7 @@ describe("ChaosHandler.ts", () => {
});

it("Should return response for Manual Request Level case", async () => {
const options = new ChaosHandlerOptions(ChaosStrategy.MANUAL, 200);
const options = new ChaosHandlerOptions(ChaosStrategy.MANUAL, "Manual Request level case", 200);
const cxt: Context = {
request: "https://graph.microsoft.com/v1.0/me",
options: {
Expand Down
4 changes: 2 additions & 2 deletions src/middleware/options/ChaosHandlerOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ export class ChaosHandlerOptions implements MiddlewareOptions {
* @constructor
* To create an instance of Testing Handler Options
* @param {ChaosStrategy} ChaosStrategy - Specifies the startegy used for the Testing Handler -> RAMDOM/MANUAL
* @param {number?} statusCode - The statusCode to be returned in the response
* @param {string} statusMessage - The Message to be returned in the response
* @param {number?} statusCode - The statusCode to be returned in the response
* @param {number?} chaosPercentage - The percentage of randomness/chaos in the handler
* @param {any?} responseBody - The response body to be returned in the response
* @returns An instance of ChaosHandlerOptions
*/
public constructor(chaosStrategy: ChaosStrategy = ChaosStrategy.RANDOM, statusCode?: number, statusMessage: string = "Some error Happened", chaosPercentage?: number, responseBody?: any) {
public constructor(chaosStrategy: ChaosStrategy = ChaosStrategy.RANDOM, statusMessage: string = "Some error Happened", statusCode?: number, chaosPercentage?: number, responseBody?: any) {
this.chaosStrategy = chaosStrategy;
this.statusCode = statusCode;
this.statusMessage = statusMessage;
Expand Down