Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Commit cae8448

Browse files
committed
Use "fat arrow" notation or anonymous functions.
1 parent 0c41a48 commit cae8448

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

Week8/solution/tests/app-test.js

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@ const assert = require('assert');
44
const sinon = require('sinon');
55
const app = require('../sources/app');
66

7-
describe("createQueryString()", function () {
8-
describe("given no params", function () {
9-
it("should return empty string", function () {
7+
describe("createQueryString()", () => {
8+
describe("given no params", () => {
9+
it("should return empty string", () => {
1010
assert.equal(app.createQueryString(), "");
1111
});
1212
});
13-
describe("given empty params", function () {
14-
it("should return empty string", function () {
13+
describe("given empty params", () => {
14+
it("should return empty string", () => {
1515
assert.equal(app.createQueryString([]), "");
1616
});
1717
});
18-
describe("given a single parameter name and value", function () {
19-
it("should return question mark followed by name, equals-sign and value", function () {
18+
describe("given a single parameter name and value", () => {
19+
it("should return question mark followed by name, equals-sign and value", () => {
2020
assert.equal(app.createQueryString([{ name: "name", value: "value"}]), "?name=value");
2121
});
2222
});
23-
describe("given several parameters", function () {
24-
it("should return name-value pairs separated by ampersands", function () {
23+
describe("given several parameters", () => {
24+
it("should return name-value pairs separated by ampersands", () => {
2525
assert.equal(
2626
app.createQueryString([{ name: "name", value: "value"}, { name: "otherName", value: "otherValue" }]),
2727
"?name=value&otherName=otherValue"
@@ -30,16 +30,24 @@ describe("createQueryString()", function () {
3030
});
3131
});
3232

33-
describe("makeGetRequest()", function () {
33+
describe("makeGetRequest()", () => {
3434
var xhr, requests;
3535

36-
before(function () {
36+
before(() => {
3737
xhr = sinon.useFakeXMLHttpRequest();
3838
requests = [];
3939
xhr.onCreate = function (req) { requests.push(req); };
4040
});
41-
after(function () {
41+
after(() => {
4242
xhr.restore();
4343
});
4444

45+
describe("returning OK status", () => {
46+
47+
});
48+
49+
describe("returning non-OK status", () => {
50+
51+
});
52+
4553
});

0 commit comments

Comments
 (0)