From 5a3c108685260835afbeeb022b24f2ddb3b05cfb Mon Sep 17 00:00:00 2001 From: Adrien Joly <531781+adrienjoly@users.noreply.github.com> Date: Fri, 6 Dec 2019 12:02:30 +0100 Subject: [PATCH 1/3] fix formatting on examples of readme.md --- readme.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/readme.md b/readme.md index 6e3eb6d..4acf39e 100644 --- a/readme.md +++ b/readme.md @@ -143,27 +143,27 @@ noe -b junit -w 'test/*.js' -- 'test/*.js' var it = junit(); (async () => { // Async tests. - it("test 1", () => + it('test 1', () => { // We use `it.eq` to assert on both simple type and complex object. - it.eq("ok", "ok") - ); - - it("test 2", async () => { + it.eq('ok', 'ok'); + }); + + it('test 2', async () => { // No more callback hell while testing async functions. await new junit.Promise(r => setTimeout(r, 1000)); - + return it.eq({ a: 1, b: 2 }, { a: 1, b: 2 }); }); - + // Run sync tests within the main async flow. - await it("test 3", (after) => + await it('test 3', (after) => { after(() => { // do some clean work after the test }); - - it.eq("ok", "ok") - ); - + + it.eq('ok', 'ok'); + }); + it.run(); })(); ``` @@ -174,7 +174,7 @@ noe -b junit -w 'test/*.js' -- 'test/*.js' ```js import junit from "junit"; var it = junit({ - filter: (msg) => msg.indexOf("test") + filter: (msg) => msg.indexOf("test"); }); (async () => { From 9fd7bf5b8574ee17944afd932dfc6b22a02f9413 Mon Sep 17 00:00:00 2001 From: Adrien Joly <531781+adrienjoly@users.noreply.github.com> Date: Fri, 6 Dec 2019 12:03:40 +0100 Subject: [PATCH 2/3] use double quotes --- readme.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/readme.md b/readme.md index 4acf39e..96b490e 100644 --- a/readme.md +++ b/readme.md @@ -143,12 +143,12 @@ noe -b junit -w 'test/*.js' -- 'test/*.js' var it = junit(); (async () => { // Async tests. - it('test 1', () => { + it("test 1", () => { // We use `it.eq` to assert on both simple type and complex object. - it.eq('ok', 'ok'); + it.eq("ok", "ok"); }); - it('test 2', async () => { + it("test 2", async () => { // No more callback hell while testing async functions. await new junit.Promise(r => setTimeout(r, 1000)); @@ -156,12 +156,12 @@ noe -b junit -w 'test/*.js' -- 'test/*.js' }); // Run sync tests within the main async flow. - await it('test 3', (after) => { + await it("test 3", (after) => { after(() => { // do some clean work after the test }); - it.eq('ok', 'ok'); + it.eq("ok", "ok"); }); it.run(); From ae86ef8766306086fbc617405402682dba77ddc9 Mon Sep 17 00:00:00 2001 From: Adrien Joly <531781+adrienjoly@users.noreply.github.com> Date: Fri, 6 Dec 2019 12:53:36 +0100 Subject: [PATCH 3/3] fix: make sure that expectations are returned --- readme.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index 96b490e..f8094c1 100644 --- a/readme.md +++ b/readme.md @@ -143,10 +143,10 @@ noe -b junit -w 'test/*.js' -- 'test/*.js' var it = junit(); (async () => { // Async tests. - it("test 1", () => { + it("test 1", () => // We use `it.eq` to assert on both simple type and complex object. - it.eq("ok", "ok"); - }); + it.eq("ok", "ok") + ); it("test 2", async () => { // No more callback hell while testing async functions. @@ -161,7 +161,7 @@ noe -b junit -w 'test/*.js' -- 'test/*.js' // do some clean work after the test }); - it.eq("ok", "ok"); + return it.eq("ok", "ok"); }); it.run();