Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: migrate to jest #61

Merged
merged 6 commits into from
Sep 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Dynamic page title & meta tags generator for **Angular**
[![Linux build](https://travis-ci.org/fulls1z3/ngx-meta.svg?branch=v0.2.x)](https://travis-ci.org/fulls1z3/ngx-meta)
[![Windows build](https://ci.appveyor.com/api/projects/status/github/fulls1z3/ngx-meta?branch=v0.2.x&svg=true)](https://ci.appveyor.com/project/fulls1z3/ngx-meta)
[![coverage](https://codecov.io/github/fulls1z3/ngx-meta/coverage.svg?branch=v0.2.x)](https://codecov.io/gh/fulls1z3/ngx-meta)
[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest)
[![Angular Style Guide](https://mgechev.github.io/angular2-style-guide/images/badge.svg)](https://angular.io/styleguide)

> Please support this project by simply putting a Github star. Share this library with friends on Twitter and everywhere else you can.
Expand Down
88 changes: 0 additions & 88 deletions config/webpack.test.js

This file was deleted.

37 changes: 24 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,22 @@
"clean": "gulp clean --color",
"lint": "gulp tslint --color",
"make": "gulp make --color",
"test": "gulp test --color"
"test": "jest --runInBand --colors"
},
"devDependencies": {
"@angular/common": "~2.4.0",
"@angular/compiler": "~2.4.0",
"@angular/compiler-cli": "~2.4.0",
"@angular/core": "~2.4.0",
"@angular/platform-browser": "~2.4.0",
"@angular/platform-browser-dynamic": "~2.4.0",
"@angular/router": "~3.4.0",
"core-js": "^2.4.1",
"rxjs": "^5.0.1",
"zone.js": "^0.7.2",
"@types/jasmine": "^2.5.54",
"lodash": "^4.17.4",
"@types/lodash": "4.14.55",
"@types/jest": "^20.0.8",
"gulp": "gulpjs/gulp#4.0",
"gulp-load-plugins": "^1.5.0",
"rimraf": "^2.6.1",
Expand All @@ -41,20 +44,28 @@
"webpack": "^3.5.5",
"tslint-loader": "^3.5.3",
"awesome-typescript-loader": "^3.2.3",
"jasmine-core": "^2.8.0",
"karma": "^1.7.1",
"karma-jasmine": "^1.1.0",
"karma-coverage": "^1.1.1",
"karma-mocha-reporter": "^2.2.4",
"karma-coverage-istanbul-reporter": "^1.3.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^2.0.4",
"karma-chrome-launcher": "^2.2.0",
"source-map-loader": "^0.2.1",
"istanbul-instrumenter-loader": "^3.0.0",
"jest": "^20.0.4",
"jest-preset-angular": "^2.0.5",
"codelyzer": "^3.1.2",
"tslint": "~5.7.0",
"angular-tslint-rules": "^1.0.4",
"typescript": "~2.1.6"
},
"jest": {
"preset": "jest-preset-angular",
"setupTestFrameworkScriptFile": "./config/jest.setup.ts",
"globals": {
"ts-jest": {
"tsConfigFile": "./tsconfig.json"
},
"__TRANSFORM_HTML__": true
},
"cache": false,
"noStackTrace": true,
"silent": true,
"collectCoverage": true,
"collectCoverageFrom": [
"packages/@ngx-meta/core/src/**.ts"
]
}
}
51 changes: 0 additions & 51 deletions packages/@ngx-meta/core/config/karma.conf.js

This file was deleted.

28 changes: 0 additions & 28 deletions packages/@ngx-meta/core/config/spec-bundle.js

This file was deleted.

10 changes: 4 additions & 6 deletions packages/@ngx-meta/core/tests/meta.loader.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// angular
import { getTestBed } from '@angular/core/testing';
import { TestBed } from '@angular/core/testing';

// module
import { MetaLoader, MetaService, MetaSettings, MetaStaticLoader } from '../index';
import { defaultSettings, emptySettings, testModuleConfig, testSettings } from './index.spec';
import { defaultSettings, emptySettings, testModuleConfig, testSettings } from './common';

describe('@ngx-meta/core:',
() => {
Expand Down Expand Up @@ -35,8 +35,7 @@ describe('@ngx-meta/core:',
useFactory: (metaFactory)
});

const injector = getTestBed();
const meta = injector.get(MetaService);
const meta = TestBed.get(MetaService);

expect(MetaStaticLoader).toBeDefined();
expect(meta.loader).toBeDefined();
Expand All @@ -56,8 +55,7 @@ describe('@ngx-meta/core:',
useClass: CustomLoader
});

const injector = getTestBed();
const meta = injector.get(MetaService);
const meta = TestBed.get(MetaService);

expect(CustomLoader).toBeDefined();
expect(meta.loader).toBeDefined();
Expand Down
Loading