From a7d0d0c1f5a3de3c246a9a79db97660071948d8e Mon Sep 17 00:00:00 2001 From: Rob Ferguson Date: Sun, 26 Nov 2017 17:15:59 +1100 Subject: [PATCH] Updated the README.md file --- README.md | 7 +- protractor.conf.js | 41 +++++++++++ src/pages/sign-in/sign-in.spec.ts | 3 +- src/tsconfig.spec.json | 4 +- tsconfig.json | 3 + tslint.json | 114 ++++++++++++++++++++++++++++-- 6 files changed, 163 insertions(+), 9 deletions(-) create mode 100644 protractor.conf.js diff --git a/README.md b/README.md index 35af4be..76144a2 100644 --- a/README.md +++ b/README.md @@ -358,7 +358,7 @@ Updated `tsconfig.ng-cli.json` in `compilerOptions`: } ``` -Updated `angular-cli.json` in `apps`: +Updated `.angular-cli.json` in `apps`: ```json "environments": { "dev": "environments/environment.dev.ts", @@ -366,6 +366,11 @@ Updated `angular-cli.json` in `apps`: } ``` +Updated `/src/tsconfig.spec.json` in `compilerOptions`: +```json +"baseUrl": "./", +``` + ### Jasmine The [Jasmine test framework](https://jasmine.github.io/2.4/introduction.html) provides everything needed to write basic tests. diff --git a/protractor.conf.js b/protractor.conf.js new file mode 100644 index 0000000..dcf9712 --- /dev/null +++ b/protractor.conf.js @@ -0,0 +1,41 @@ +exports.config = { + allScriptsTimeout: 11000, + specs: [ + './e2e/**/*.e2e-spec.ts' + ], + capabilities: { + 'browserName': 'chrome', + chromeOptions: { + args: ['--no-sandbox'] + } + }, + directConnect: true, + baseUrl: 'http://localhost:4200/', + framework: 'jasmine', + jasmineNodeOpts: { + showColors: true, + defaultTimeoutInterval: 30000, + print: function() {} + }, + useAllAngular2AppRoots: true, + beforeLaunch: function() { + require('ts-node').register({ + project: 'e2e/tsconfig.e2e.json' + }); + + require('connect')().use(require('serve-static')('www')).listen(4200); + }, + onPrepare() { + var jasmineReporters = require('jasmine-reporters'); + jasmine.getEnv().addReporter(new jasmineReporters.TerminalReporter({ + verbosity: 3, + color: true, + showStack: true + })); + jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({ + savePath: process.env.JUNIT_REPORT_PATH, + outputFile: process.env.JUNIT_REPORT_NAME, + consolidateAll: true + })); + } +}; diff --git a/src/pages/sign-in/sign-in.spec.ts b/src/pages/sign-in/sign-in.spec.ts index b510297..38276af 100644 --- a/src/pages/sign-in/sign-in.spec.ts +++ b/src/pages/sign-in/sign-in.spec.ts @@ -2,7 +2,8 @@ import { ComponentFixture, async } from '@angular/core/testing'; import { TestUtils } from '../../test'; -import { SignInPage } from './sign-in'; +// import { SignInPage } from './sign-in'; +import { SignInPage } from '@pages/sign-in/sign-in'; let fixture: ComponentFixture = null; let instance: any = null; diff --git a/src/tsconfig.spec.json b/src/tsconfig.spec.json index e2155c2..538379a 100644 --- a/src/tsconfig.spec.json +++ b/src/tsconfig.spec.json @@ -1,10 +1,10 @@ { "extends": "../tsconfig.ng-cli.json", "compilerOptions": { - "outDir": "../out-tsc/spec", + "outDir": "../dist/out-tsc/spec", "module": "commonjs", "target": "es5", - "baseUrl": "", + "baseUrl": "./", "types": [ "jasmine", "node" diff --git a/tsconfig.json b/tsconfig.json index e28cd11..f80efcd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,6 +15,9 @@ "typeRoots": [ "../node_modules/@types" ], + "types": [ + "jasmine" + ], "baseUrl": "./src", "paths": { "@app/*": [ "app/*" ], diff --git a/tslint.json b/tslint.json index 40bdadf..82154d6 100644 --- a/tslint.json +++ b/tslint.json @@ -1,8 +1,112 @@ { "rules": { - "no-duplicate-variable": true - }, - "rulesDirectory": [ - "node_modules/tslint-eslint-rules/dist/rules" - ] + "align": [ + true, + "parameters", + "arguments", + "statements" + ], + "ban": false, + "class-name": true, + "comment-format": [ + true, + "check-space" + ], + "curly": false, + "eofline": true, + "forin": false, + "indent": [ + true, + "spaces" + ], + "interface-name": false, + "jsdoc-format": true, + "label-position": true, + "max-line-length": [ + true, + 180 + ], + "member-access": true, + "member-ordering": [false], + "no-any": false, + "no-arg": true, + "no-bitwise": true, + "no-conditional-assignment": true, + "no-consecutive-blank-lines": true, + "no-console": [false], + "no-construct": false, + "no-debugger": true, + "no-duplicate-variable": true, + "no-empty": true, + "no-eval": true, + "no-inferrable-types": false, + "no-internal-module": true, + "no-require-imports": false, + "no-shadowed-variable": true, + "no-string-literal": false, + "no-switch-case-fall-through": true, + "no-trailing-whitespace": true, + "no-unused-variable": [ + true, + "check-parameters", + { "ignore-pattern": "^ng*|^on*" } + ], + "no-use-before-declare": true, + "no-var-keyword": true, + "no-var-requires": true, + "object-literal-sort-keys": false, + "one-line": [ + true, + "check-open-brace", + "check-whitespace" + ], + "quotemark": [ + true, + "single", + "avoid-escape" + ], + "radix": false, + "semicolon": true, + "switch-default": false, + "trailing-comma": [ + true, + { + "multiline": "always", + "singleline": "never" + } + ], + "triple-equals": [true], + "typedef": [ + true, + "call-signature", + "parameter", + "property-declaration", + "variable-declaration", + "member-variable-declaration" + ], + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + } + ], + "variable-name": [ + true, + "check-format", + "allow-leading-underscore", + "ban-keywords" + ], + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-type" + ] + } }