Skip to content

Commit 0cebf0a

Browse files
author
Max Beatty
committed
hello world
0 parents  commit 0cebf0a

File tree

13 files changed

+195
-0
lines changed

13 files changed

+195
-0
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.eslintrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"env": {
3+
"node": true
4+
}
5+
}

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
coverage.html
3+
lcov.info

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
iojs-v1.2.0

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
language: node_js
2+
node_js:
3+
- iojs

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
test:
2+
@node node_modules/lab/bin/lab -L
3+
test-cov:
4+
@node node_modules/lab/bin/lab -c -L -r lcov -o lcov.info
5+
test-cov-html:
6+
@node node_modules/lab/bin/lab -r html -o coverage.html
7+
8+
.PHONY: test test-cov test-cov-html

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# jsperf.com
2+
3+
[![Build Status](https://travis-ci.org/jsperf/jsperf.com.svg?branch=master)](https://travis-ci.org/jsperf/jsperf.com)
4+
5+
## How to run a local copy of jsPerf for testing/debugging
6+
7+
### Prerequisites
8+
9+
You'll need [io.js](https://iojs.org/en/index.html) and [mysql](https://www.mysql.com/downloads/) installed.
10+
11+
1. Clone the repository (`git clone https://github.com/jsperf/jsperf.com.git`)
12+
2. Install dependencies (`npm install`)
13+
14+
### Environment Variables
15+
16+
You'll need to provide the following environment variables:
17+
18+
- `PORT`
19+
20+
### Run
21+
22+
```
23+
npm start
24+
```
25+
26+
## Testing
27+
28+
We use [lab](https://github.com/hapijs/lab) as our test utility and [code](https://github.com/hapijs/code) as our assertion library. Lab enforces linting with [eslint](http://eslint.org/). To run the test suite:
29+
30+
```
31+
make test
32+
```
33+
34+
### Coverage
35+
36+
When [travis-ci](https://travis-ci.org) runs the tests, it enforces 100% code coverage. You can run this locally with either `make test-cov` or `npm test`
37+
38+
#### HTML Report
39+
40+
To generate an HTML report with code coverage, run `make test-cov-html`

index.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"use strict";
2+
3+
var Hapi = require("hapi");
4+
5+
var server = new Hapi.Server();
6+
server.connection({ port: process.env.PORT });
7+
8+
server.route({
9+
method: "GET",
10+
path: "/",
11+
handler: function (request, reply) {
12+
reply("Hello, world!");
13+
}
14+
});
15+
16+
module.exports = server;

package.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "jsperf.com",
3+
"version": "0.0.0",
4+
"description": "jsPerf aims to provide an easy way to create and share test cases, comparing the performance of different JavaScript snippets by running benchmarks",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "make test-cov"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "[email protected]:jsperf/jsperf.com.git"
12+
},
13+
"keywords": [
14+
"jsperf"
15+
],
16+
"contributors": [
17+
"Max Beatty"
18+
],
19+
"bugs": {
20+
"url": "https://github.com/jsperf/jsperf.com/issues"
21+
},
22+
"homepage": "https://github.com/jsperf/jsperf.com",
23+
"dependencies": {
24+
"good": "^5.1.2",
25+
"good-console": "^4.1.0",
26+
"hapi": "^8.2.0"
27+
},
28+
"devDependencies": {
29+
"code": "^1.3.0",
30+
"lab": "^5.2.1"
31+
}
32+
}

0 commit comments

Comments
 (0)