Skip to content

Commit ae28b98

Browse files
committed
2.1 author key
1 parent 6bfa2e3 commit ae28b98

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

coderoad/test/packagejson.test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const { getPackageJson } = require("./utils");
2+
const assert = require("assert");
3+
4+
describe("package.json", () => {
5+
let json;
6+
before(async () => {
7+
json = await getPackageJson();
8+
});
9+
// 1.1
10+
it('should have a valid "author" key', () => {
11+
assert.ok(json.author, 'no "author" key provided');
12+
assert.equal(
13+
typeof json.author,
14+
"string",
15+
'should have an "author" value that is a string'
16+
);
17+
});
18+
});

package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "fcc-learn-npm",
3+
"repository": {
4+
"type": "git",
5+
"url": "https://github.com/coderoad/fcc-learn-npm"
6+
},
7+
"main": "server.js",
8+
"scripts": {
9+
"start": "node server.js"
10+
},
11+
"dependencies": {
12+
"express": "^4.17.0"
13+
}
14+
}

server.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const express = require("express");
2+
const app = express();
3+
const port = 3000;
4+
5+
app.get("/", (req, res) => res.send("Hello World!"));
6+
7+
app.listen(port, () =>
8+
console.log(`Example app listening at http://localhost:${port} !`)
9+
);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy