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

fix tests #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
File renamed without changes.
4 changes: 1 addition & 3 deletions __tests__/example-test.ts → __tests__/example-test.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe("sample snapshotting", () =>
describe("complex examples", () =>
{
let snapshots = {
"sample snapshotting complex examples does a more complex js snapshot 1": `{ "DEFAULT_TIMEOUT_INTERVAL": 5000, "MAX_PRETTY_PRINT_ARRAY_LENGTH": 100, "MAX_PRETTY_PRINT_DEPTH": 40, "currentEnv_": { "clock": {} }, "errors": {}, "matchers": {}, "matchersUtil": {}, "util": {}, "version": "2.6.1"}`,
"sample snapshotting complex examples does a more complex js snapshot 1": `{ "DEFAULT_TIMEOUT_INTERVAL": 5000, "MAX_PRETTY_PRINT_ARRAY_LENGTH": 50, "MAX_PRETTY_PRINT_CHARS": 1000, "MAX_PRETTY_PRINT_DEPTH": 8, "currentEnv_": { "clock": {} }, "matchers": {}, "matchersUtil": {}, "util": {}, "version": "2.99.0"}`,
"sample snapshotting complex examples does a more complex html snapshot 1": `{ "script": { "__text": "window.__karma__.loaded();", "_type": "text/javascript" }}`
};

Expand All @@ -45,7 +45,6 @@ describe("sample snapshotting", () =>
it("does a more complex js snapshot", () =>
{
let actual = jasmine as any;
actual.location = document.location;
delete actual.errors;

expectjs(actual).toMatchSnapshot();
Expand All @@ -54,7 +53,6 @@ describe("sample snapshotting", () =>
it("does a more complex html snapshot", () =>
{
let actual = window.document.body.innerHTML;

expectxml(actual).toMatchSnapshot();
});
});
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = function (config)

// list of files / patterns to load in the browser
files: [
'./__tests__/example-test.ts',
'./__tests__/example-test.test.ts',
// './__tests__/**/*.ts',
'./src/**/*.ts'
],
Expand Down Expand Up @@ -83,7 +83,7 @@ module.exports = function (config)

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,
singleRun: true,

// Concurrency level
// how many browser should be started simultaneous
Expand Down
19 changes: 12 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,25 @@
"scripts": {
"build": "webpack --env build -p",
"dev": "webpack --progress --colors --watch --env dev",
"test": "jest"
"test": "jest",
"example:test": "karma start"
},
"dependencies": {
"@types/vkbeautify": "^0.99.1",
"@types/node": "^7.0.18",
"difflib": "^0.2.4",
"ts-promise": "^0.3.4",
"vkbeautify": "^0.99.2",
"x2js": "^3.1.0"
},
"devDependencies": {
"@types/jasmine": "^2.5.47",
"jasmine": "^2.6.0",
"jasmine-core": "^2.6.1",
"jasmine-core": "^2.99.0",
"jest": "^22.4.3",
"karma": "^1.6.0",
"karma-chrome-launcher": "^2.1.1",
"karma-jasmine": "^1.1.0",
"karma-typescript": "^3.0.1",
"karma": "^1.6.0",
"ts-jest": "^22.4.5",
"ts-loader": "^2.0.3",
"tslint": "*",
"typescript": "*",
Expand Down Expand Up @@ -63,7 +64,11 @@
"transform": {
".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js"
},
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
"testResultsProcessor": "<rootDir>/node_modules/ts-jest/coverageprocessor.js"
"testMatch": [
"<rootDir>/__tests__/**/*.spec.ts"
],
"collectCoverageFrom": [
"src/index.ts"
]
}
}