Skip to content

Commit 68badcd

Browse files
committed
project setup
1 parent db4fdef commit 68badcd

File tree

8 files changed

+43
-19
lines changed

8 files changed

+43
-19
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
.idea/*
2-
*.log
2+
*.log
3+
node_modules
4+
coverage

.travis.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
language: node_js
22
node_js:
33
- node
4-
script: "make"
5-
after_success: "make coveralls"
4+
install:
5+
- npm install
6+
7+
script:
8+
- npm run lint
9+
- npm run lint-test
10+
- npm run cover
11+
12+
after_script:
13+
- "cat coverage/lcov.info | node_modules/coveralls/bin/coveralls.js"

.vscode/tasks.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
"command": "echo Hello"
1010
}
1111
]
12-
}
12+
}

dist/js/app.js

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
'use strict';
22

3-
// @ts-check
4-
5-
var myvar;
6-
7-
console.log('Hello World!');
8-
9-
myvar++;
10-
console.log(myvar);
3+
Object.defineProperty(exports, "__esModule", {
4+
value: true
5+
});
6+
exports.hello = hello;
7+
function hello() {
8+
return 'Hello World!';
9+
}
10+
11+
exports.default = hello;

dist/ts/app.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
"use strict";
2-
console.log('Hello');
2+
Object.defineProperty(exports, "__esModule", { value: true });
3+
function hello() {
4+
return 'Hello World!';
5+
}
6+
exports.hello = hello;
7+
exports.default = hello;

lib/js/app2.js

-1
This file was deleted.

package.json

+12-3
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,32 @@
1212
"bugs": {
1313
"url": "https://github.com/loiane/javascript-datastructures-algorithms/issues"
1414
},
15-
"homepage": "https://github.com/loiane/javascript-datastructures-algorithms#readme",
15+
"homepage": "https://github.com/loiane/javascript-datastructures-algorithms",
1616
"scripts": {
17+
"clean": "rm -rf ./dist; mkdir ./dist",
18+
"lint": "node_modules/.bin/eslint src/index.js",
19+
"lint-test": "node_modules/.bin/eslint test/index.js",
1720
"build:js": "babel lib/js --presets babel-preset-es2015 --out-dir dist/js",
1821
"build:ts": "tsc",
1922
"build": "npm run build:js && npm run build:ts",
20-
"test": "mocha --compilers js:babel-core/register --colors ./test/js/*.spec.js"
23+
"test:js": "mocha --compilers js:babel-core/register --colors -R spec --recursive ./test/js",
24+
"test:ts": "mocha -r ts-node/register --colors --recursive ./test/ts/**/*.spec.ts",
25+
"test": "npm run test:js && npm run test:ts",
26+
"coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -R spec --recursive ./test/js -- --compilers js:babel-core/register",
27+
"go": "npm run clean && npm run test && npm run build"
2128
},
2229
"devDependencies": {
30+
"@types/chai": "^4.0.4",
2331
"@types/mocha": "^2.2.42",
2432
"babel-cli": "^6.26.0",
33+
"babel-core": "^6.26.0",
2534
"babel-eslint": "^7.2.3",
2635
"babel-plugin-add-module-exports": "^0.2.1",
2736
"babel-preset-es2015": "^6.24.1",
2837
"chai": "^4.1.2",
2938
"coveralls": "^2.13.1",
3039
"eslint": "^4.6.1",
31-
"istanbul": "^0.4.5",
40+
"istanbul": "^v1.1.0-alpha.1",
3241
"mocha": "^3.5.0",
3342
"ts-node": "^3.3.0",
3443
"typings": "^2.1.1"

test/ts/app.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import hello from './hello';
1+
import hello from './../../lib/ts/app';
22
import { expect } from 'chai';
33
// if you used the '@types/mocha' method to install mocha type definitions, uncomment the following line
4-
// import 'mocha';
4+
import 'mocha';
55

66
describe('Hello function', () => {
77
it('should return hello world', () => {

0 commit comments

Comments
 (0)