Skip to content

Commit

Permalink
adding test + getting the working -.-
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenlautier committed May 16, 2016
1 parent dae67d9 commit 6ae0682
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 6 deletions.
32 changes: 27 additions & 5 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,55 @@ module.exports = function (config) {
config.set({
basePath: "./",
frameworks: ["systemjs", "jasmine"],

systemjs: {
configFile: "system.config.js",
// configFile: "system.config.js",
config: {
paths: {
"*": "*",
"src/*": "src/*",
"typescript": "node_modules/typescript/lib/typescript.js",
"systemjs": "node_modules/systemjs/dist/system.js",
"system-polyfills": "node_modules/systemjs/dist/system-polyfills.js",
"es6-module-loader": "node_modules/es6-module-loader/dist/es6-module-loader.js"
"es6-module-loader": "node_modules/es6-module-loader/dist/es6-module-loader.js",
"n:*": "node_modules/*",
},
map: {
"@angular": "n:@angular",
"rxjs": "n:rxjs"
},
packages: {
"src": {
defaultExtension: "ts"
},
"rxjs": {
defaultExtension: "js"
},
"@angular/core": {
main: "index.js",
defaultExtension: "js"
}
},
transpiler: "typescript"
},
serveFiles: [
"src/**/*.ts",
"jspm_packages/**/*.js"
"node_modules/**/*.js"
]
},
files: [
// Polyfills.
"node_modules/es6-shim/es6-shim.js",
"node_modules/reflect-metadata/Reflect.js",

// Zone.js dependencies
"node_modules/zone.js/dist/zone.js",
"node_modules/zone.js/dist/jasmine-patch.js",
"node_modules/zone.js/dist/async-test.js",
"node_modules/zone.js/dist/fake-async-test.js",

"src/**/*.spec.ts",
"src/*.spec.ts"
"src/*.spec.ts",
],
exclude: [],
preprocessors: {},
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
"yargs": "^4.6.0",
"@angular/core": "^2.0.0-rc.1",
"rxjs": "5.0.0-beta.6",
"zone.js": "^0.6.12"
"zone.js": "^0.6.12",
"reflect-metadata": "^0.1.3",
"es6-shim": "^0.35.0"
},
"dependencies": {},
"peerDependencies": {
Expand Down
22 changes: 22 additions & 0 deletions src/logging/logger.service.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {
it,
inject,
describe,
expect,
beforeEach,
beforeEachProviders
} from "@angular/core/testing";
import {LoggerService} from "./logger.service";

describe("LoggerService", () => {
beforeEachProviders(() => [LoggerService]);
beforeEach(() => {
spyOn(console, "log");
});

it("should log successfully", inject([LoggerService], (logger: LoggerService) => {
let message = "Hello";
logger.log("log", message);
expect(console.log).toHaveBeenCalledWith(message);
}));
});

0 comments on commit 6ae0682

Please sign in to comment.