Skip to content

Commit 78abc56

Browse files
committed
Upgrading project dependencies
1 parent 2b3869a commit 78abc56

File tree

14 files changed

+185
-127
lines changed

14 files changed

+185
-127
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
44
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
55

6+
/lib
7+
package-lock.json
8+
69
# User-specific stuff:
710
.idea/
811

.prettierrc

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

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
language: node_js
22
node_js:
3+
- "10"
4+
- "8"
35
- "6"
46
- "6.1"
57
- "5.11"

codecov.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
1+
coverage:
2+
parsers:
3+
javascript:
4+
enable_partials: yes
5+
status:
6+
project:
7+
default:
8+
target: "83%"
9+
patch:
10+
enabled: false

index.js

Lines changed: 0 additions & 53 deletions
This file was deleted.

index.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

index.ts

Lines changed: 0 additions & 58 deletions
This file was deleted.

package.json

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,30 @@
22
"name": "node-rx-http",
33
"version": "1.0.1",
44
"description": "A simple Rx wrapper around the native Node http module",
5-
"main": "index.js",
5+
"main": "./lib/bundle.umd.js",
6+
"module": "./lib/index.js",
7+
"jsnext:main": "./lib/index.js",
8+
"typings": "./lib/index.d.ts",
69
"scripts": {
7-
"test": "mocha"
10+
"build": "tsc -p .",
11+
"bundle": "rollup -c",
12+
"test": "jest",
13+
"clean": "rimraf lib/* && rimraf coverage/*",
14+
"postbuild": "npm run bundle",
15+
"prebuild": "npm run clean",
16+
"prepublishOnly": "npm run clean && npm run build",
17+
"coverage": "npm run lint && jest --coverage",
18+
"coverage:upload": "codecov",
19+
"check-types": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.tests.json"
820
},
9-
"repository": "https://github.com/Dapperware/node-rx-http.git",
21+
"repository": {
22+
"type": "git",
23+
"url": "git+https://github.com/Dapperware/node-rx-http.git"
24+
},
25+
"bugs": {
26+
"url": "https://github.com/Dapperware/node-rx-http/issues"
27+
},
28+
"homepage": "https://github.com/Dapperware/node-rx-http#readme",
1029
"keywords": [
1130
"rx",
1231
"reactive-extensions",
@@ -20,8 +39,32 @@
2039
"rxjs": "^6.2.2"
2140
},
2241
"devDependencies": {
42+
"@types/jest": "^23.3.1",
2343
"chai": "^4.1.2",
44+
"jest": "^23.5.0",
45+
"jest-fetch-mock": "^1.6.5",
2446
"mocha": "^5.2.0",
25-
"nock": "^9.6.1"
47+
"nock": "^9.6.1",
48+
"prettier": "^1.14.2",
49+
"rimraf": "^2.6.2",
50+
"rollup": "^0.65.0",
51+
"rollup-plugin-sourcemaps": "^0.4.2",
52+
"ts-jest": "^23.1.4",
53+
"typescript": "^2.9.2",
54+
"uglify-js": "^3.4.8"
55+
},
56+
"jest": {
57+
"globals": {
58+
"ts-jest": {
59+
"useBabelrc": false,
60+
"mapCoverage": true
61+
}
62+
},
63+
"mapCoverage": true,
64+
"transform": {
65+
".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js"
66+
},
67+
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
68+
"moduleFileExtensions": ["ts", "tsx", "js", "json"]
2669
}
2770
}

rollup.config.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import sourcemaps from 'rollup-plugin-sourcemaps';
2+
3+
export default {
4+
input: 'lib/index.js',
5+
output: {
6+
file: 'lib/bundle.umd.js',
7+
format: 'umd',
8+
exports: 'named',
9+
name: 'node-rx-http',
10+
sourcemaps: true
11+
},
12+
onwarn,
13+
plugins: [sourcemaps()]
14+
}
15+
16+
function onwarn(message) {
17+
const suppressed = ['UNRESOLVED_IMPORT', 'THIS_IS_UNDEFINED'];
18+
19+
if (!suppressed.find(code => message.code === code)) {
20+
return console.warn(message.message);
21+
}
22+
}

test/method-tests.js renamed to src/__tests__/index.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
var RxHttp = require('../index');
2-
var nock = require('nock');
3-
var expect = require('chai').expect;
1+
import RxHttp from '../index';
2+
const nock = require('nock');
43

54
describe('request', function () {
65
describe('get', function () {
@@ -13,8 +12,8 @@ describe('request', function () {
1312
it('should forward errors to the handler', function (done) {
1413
RxHttp.get('http://example.com/error').subscribe(
1514
x => {
16-
expect(x.statusCode).to.equal(401);
17-
expect(x.body).to.equal('Error!');
15+
expect(x.statusCode).toEqual(401);
16+
expect(x.body).toEqual('Error!');
1817
},
1918
done,
2019
done
@@ -23,7 +22,7 @@ describe('request', function () {
2322

2423
it('should return 200 on success', function (done) {
2524
RxHttp.get('http://example.com/safe').subscribe(x => {
26-
expect(x.statusCode).to.equal(200);
25+
expect(x.statusCode).toEqual(200);
2726
}, done, done);
2827
});
2928
});

0 commit comments

Comments
 (0)