Skip to content

Commit

Permalink
one step forward, two steps baaack
Browse files Browse the repository at this point in the history
  • Loading branch information
moshmage committed Dec 19, 2016
1 parent 262cac3 commit 838d7f8
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"typings": "dist/index.d.ts",
"scripts": {
"test": "karma start karma.conf.js",
"posttest":"rm -rf spec/",
"posttest": "rm -rf spec/",
"prebuild": "npm run test",
"build": "ntsc"
},
Expand All @@ -25,7 +25,7 @@
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.1.0",
"karma-phantomjs-launcher": "^1.0.2",
"karma-typescript": "https://github.com/monounity/karma-typescript",
"karma-typescript": "^2.1.5",
"socket.io": "^1.7.2",
"typescript": "^2.1.4"
}
Expand Down
10 changes: 6 additions & 4 deletions src/subjects/socket-io.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
import {IO} from './socket-io';
import {ioEvent} from './io-events';
import {assign} from "rxjs/util/assign";
const socketIO = require('socket.io');
import * as io from 'socket.io';

function setUpTestServer() {
return socketIO.listen(1337).on('connection', (socket) => {
return io.listen(1337).on('connection', (socket) => {
socket.on('test-event',(socket)=> {
socket.emit('test-event', {data: true});
})
});
}
setUpTestServer();



describe('IO', () => {
it ('is instance of itself', () => {
Expand Down Expand Up @@ -101,9 +102,10 @@ describe('IO', () => {

describe('Connection', () => {
let socket = new IO();
setUpTestServer();

it('connects', () => {
console.log()
console.log('testing connects');
socket.event$.subscribe((newData)=>{
console.log('newData', newData);
expect(newData).toContain({connected: true})
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"target": "es5",
"sourceMap": false,
"removeComments": false,
"outDir": "dist/",
"declaration": true,
"moduleResolution": "node"
"moduleResolution": "node",
"outDir": "dist/",
"declarationDir": "types/"
},
"include": [
"src/**/*"
Expand Down
4 changes: 3 additions & 1 deletion tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"removeComments": true,
"outDir": "spec/",
"declaration": false,
"moduleResolution": "node"
"moduleResolution": "node",
"listFiles": true,
"baseUrl": "./"
},
"include": [
"src/**/*"
Expand Down
1 change: 1 addition & 0 deletions typings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"globalDevDependencies": {
"socket.io": "registry:dt/socket.io#1.4.4+20160915014424",
"socket.io-client": "registry:dt/socket.io-client#1.4.4+20161116080703"
}
}
1 change: 1 addition & 0 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/// <reference path="globals/socket.io-client/index.d.ts" />
/// <reference path="globals/socket.io/index.d.ts" />

0 comments on commit 838d7f8

Please sign in to comment.