Skip to content

Commit

Permalink
Travis integration & example
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil.mysliwiec committed Feb 5, 2017
1 parent 9ec2d6c commit 14b4228
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 5 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
npm-debug.log

# example
/example
/quick-start
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ before_install:
- sh -e /etc/init.d/xvfb start
script:
- npm test
- npm run build
- npm run compile
13 changes: 13 additions & 0 deletions example/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { NestApplication } from "./../src/";

export class Application implements NestApplication {

constructor(private app) {}

start() {
this.app.listen(3030, () => {
console.log("Application listen on port:", 3030);
});
}

}
7 changes: 7 additions & 0 deletions example/modules/app.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { UsersModule } from "./users/users.module";
import { Module } from "./../../src/";

@Module({
modules: [ UsersModule ]
})
export class ApplicationModule {}
4 changes: 4 additions & 0 deletions example/modules/users/users-query.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { Component } from "./../../../src/";

@Component()
export class UsersQueryService {}
9 changes: 9 additions & 0 deletions example/modules/users/users.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { UsersRoute } from "./users.route";
import { UsersQueryService } from "./users-query.service";
import { Module } from "./../../../src/";

@Module({
controllers: [ UsersRoute ],
components: [ UsersQueryService ]
})
export class UsersModule {}
16 changes: 16 additions & 0 deletions example/modules/users/users.route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Request, Response, NextFunction } from "express";
import { UsersQueryService } from "./users-query.service";
import { RequestMethod, Controller, RequestMapping } from "./../../../src/";

@Controller({ path: "users" })
export class UsersRoute {

constructor(private usersQueryService: UsersQueryService) {}

@RequestMapping({
path: "/",
method: RequestMethod.GET
})
getAllUsers(req: Request, res: Response, next: NextFunction) {}
}

5 changes: 5 additions & 0 deletions example/server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { NestRunner } from "./../src/";
import { Application } from "./app";
import { ApplicationModule } from "./modules/app.module";

NestRunner.run(Application, ApplicationModule);
6 changes: 3 additions & 3 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const webpackConfig = require('./webpack.config.test');

module.exports = function (config) {
config.set({
browsers: [ 'Chrome', 'ChromeCanary' ],
browsers: [ 'Firefox' ],
colors: true,
reporters: [ 'mocha' ],
frameworks: [ 'mocha', 'chai', 'sinon' ],
Expand All @@ -14,12 +14,12 @@ module.exports = function (config) {
'tests.webpack.js': [ 'webpack' ]
},
webpack: webpackConfig,
customLaunchers: {
/*customLaunchers: {
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
}
},
},*/
singleRun: true
});

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^2.0.0",
"karma-coverage": "^1.1.1",
"karma-firefox-launcher": "^1.0.0",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.2",
"karma-sinon": "^1.0.5",
Expand Down

0 comments on commit 14b4228

Please sign in to comment.