Skip to content

Commit

Permalink
Simplify test case descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
dpilafian committed Sep 21, 2023
1 parent 64bc30c commit ff91777
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ describe('The web page', () => {
before(loadWebPage);
after(closeWebPage);

it('has the correct URL -> ' + url, () => {
it('has the correct URL', () => {
const actual = { url: web.window.location.href };
const expected = { url: url };
assertDeepStrictEqual(actual, expected);
});

it('has a body with exactly one header, main, and footer', () => {
it('body has exactly one header, main, and footer', () => {
const actual = getTags(web.document.querySelectorAll('body >*'));
const expected = ['header', 'main', 'footer'];
assertDeepStrictEqual(actual, expected);
Expand All @@ -121,7 +121,7 @@ Above mocha test will output:
```
The web page
✓ has the correct URL -> https://pretty-print-json.js.org/
has a body with exactly one header, main, and footer
✓ body has exactly one header, main, and footer
The document content
✓ has a 🚀 traveling to 🪐!
Expand Down
2 changes: 1 addition & 1 deletion hello-world/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
"fetch-json": "~3.2",
"jshint": "~2.13",
"mocha": "~10.2",
"server-listening": "~1.1"
"server-listening": "~1.2"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,6 @@
"rimraf": "~5.0",
"run-scripts-util": "~1.2",
"typescript": "~5.2",
"w3c-html-validator": "~1.4"
"w3c-html-validator": "~1.5"
}
}
6 changes: 3 additions & 3 deletions spec/load-web-page.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Load Web Page specification', () => {
describe('The web page', () => {
const getTags = (elems) => [...elems].map(elem => elem.nodeName.toLowerCase());

it('has the correct URL -> ' + url, () => {
it('has the correct URL', () => {
const actual = { url: web.window.location.href };
const expected = { url: url };
assertDeepStrictEqual(actual, expected);
Expand All @@ -28,13 +28,13 @@ describe('The web page', () => {
assertDeepStrictEqual(actual, expected);
});

it('has a body with exactly one header, main, and footer -- body.children', () => {
it('body has exactly one header, main, and footer -- body.children', () => {
const actual = getTags(web.document.body.children);
const expected = ['header', 'main', 'footer'];
assertDeepStrictEqual(actual, expected);
});

it('has a body with exactly one header, main, and footer -- querySelectorAll()', () => {
it('body has exactly one header, main, and footer -- querySelectorAll()', () => {
const actual = getTags(web.document.querySelectorAll('body >*'));
const expected = ['header', 'main', 'footer'];
assertDeepStrictEqual(actual, expected);
Expand Down
4 changes: 2 additions & 2 deletions spec/start-web-server.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ describe('The sample web page', () => {
assertDeepStrictEqual(actual, expected);
});

it('has a body with exactly one header, main, and footer -- body.children', () => {
it('body has exactly one header, main, and footer -- body.children', () => {
const actual = getTags(web.document.body.children);
const expected = ['header', 'main', 'footer'];
assertDeepStrictEqual(actual, expected);
});

it('has a body with exactly one header, main, and footer -- querySelectorAll()', () => {
it('body has exactly one header, main, and footer -- querySelectorAll()', () => {
const actual = getTags(web.document.querySelectorAll('body >*'));
const expected = ['header', 'main', 'footer'];
assertDeepStrictEqual(actual, expected);
Expand Down

0 comments on commit ff91777

Please sign in to comment.