From 39d695deb0e24ec4d1e7d94b3b4c9a79af0a1265 Mon Sep 17 00:00:00 2001 From: Craig Nishina Date: Fri, 3 Feb 2017 14:25:56 -0800 Subject: [PATCH] deps(typescript): use typescript@~2.0.0 - move noCF tests to install and fix reference to protractor - changed element.ts to not use keyof - remove gulp task tsc:spec --- exampleTypescript/package.json | 5 ++++- gulpfile.js | 7 ++----- lib/element.ts | 2 +- package.json | 4 ++-- scripts/test.js | 2 -- spec/install/.gitignore | 6 +----- spec/install/conf.ts | 2 +- spec/{ts => install}/noCF/plugin_spec.ts | 2 +- spec/{ts => install}/noCF/smoke_spec.ts | 2 +- spec/{ts => install}/noCFPluginConf.ts | 4 ++-- spec/{ts => install}/noCFSmokeConf.ts | 2 +- spec/install/package.json | 14 +++++++++++--- spec/install/test.js | 6 ++++-- spec/install/tsconfig.json | 3 ++- ts_spec_config.json => spec/tsconfig.json | 4 ++-- tsconfig.json | 2 +- 16 files changed, 36 insertions(+), 31 deletions(-) rename spec/{ts => install}/noCF/plugin_spec.ts (78%) rename spec/{ts => install}/noCF/smoke_spec.ts (99%) rename spec/{ts => install}/noCFPluginConf.ts (87%) rename spec/{ts => install}/noCFSmokeConf.ts (86%) rename ts_spec_config.json => spec/tsconfig.json (90%) diff --git a/exampleTypescript/package.json b/exampleTypescript/package.json index e4618b3cc..d01641fd6 100644 --- a/exampleTypescript/package.json +++ b/exampleTypescript/package.json @@ -13,6 +13,9 @@ "@types/jasmine": "^2.5.38", "jasmine": "^2.4.1", "protractor": "file:../", - "typescript": "^2.1.1" + "typescript": "~2.0.0" + }, + "devDependencies": { + "@types/jasminewd2": "^2.0.0" } } diff --git a/gulpfile.js b/gulpfile.js index 18259e9ee..c8cf6e0ae 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -94,17 +94,14 @@ gulp.task('tsc', function(done) { runSpawn(done, 'node', ['node_modules/typescript/bin/tsc']); }); -gulp.task('tsc:spec', function(done) { - runSpawn(done, 'node', ['node_modules/typescript/bin/tsc', '-p', 'ts_spec_config.json']); -}); gulp.task('prepublish', function(done) { - runSequence('checkVersion', 'jshint', 'tsc', 'built:copy', 'tsc:spec', done); + runSequence('checkVersion', 'jshint', 'tsc', 'built:copy', done); }); gulp.task('pretest', function(done) { runSequence('checkVersion', - ['webdriver:update', 'jshint', 'tslint', 'format'], 'tsc', 'built:copy', 'tsc:spec', done); + ['webdriver:update', 'jshint', 'tslint', 'format'], 'tsc', 'built:copy', done); }); gulp.task('default',['prepublish']); diff --git a/lib/element.ts b/lib/element.ts index 6eccc6f87..086dc1686 100644 --- a/lib/element.ts +++ b/lib/element.ts @@ -17,7 +17,7 @@ let WEB_ELEMENT_FUNCTIONS = [ 'click', 'sendKeys', 'getTagName', 'getCssValue', 'getAttribute', 'getText', 'getSize', 'getLocation', 'isEnabled', 'isSelected', 'submit', 'clear', 'isDisplayed', 'getId', 'takeScreenshot' -] as (keyof WebdriverWebElement)[]; +]; /** * ElementArrayFinder is used for operations on an array of elements (as opposed diff --git a/package.json b/package.json index 6f020689e..7d11634eb 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "@types/node": "^6.0.46", "@types/q": "^0.0.32", "@types/selenium-webdriver": "~2.53.39", - "blocking-proxy": "0.0.4", + "blocking-proxy": "0.0.5", "chalk": "^1.1.3", "glob": "^7.0.3", "jasmine": "^2.5.3", @@ -54,7 +54,7 @@ "semver": "^5.3.0", "tslint": "~4.3.0", "tslint-eslint-rules": "^3.2.0", - "typescript": "^2.0.0", + "typescript": "~2.0.0", "vrsource-tslint-rules": "^4.0.1" }, "repository": { diff --git a/scripts/test.js b/scripts/test.js index ce0fc84d5..b2f8421cd 100755 --- a/scripts/test.js +++ b/scripts/test.js @@ -38,8 +38,6 @@ var passingTests = [ 'node built/cli.js spec/noGlobalsConf.js', 'node built/cli.js spec/angular2Conf.js', 'node built/cli.js spec/hybridConf.js', - 'node built/cli.js spec/built/noCFSmokeConf.js', - 'node built/cli.js spec/built/noCFPluginConf.js', 'node scripts/driverProviderAttachSession.js', 'node scripts/errorTest.js', // Interactive Element Explorer tasks diff --git a/spec/install/.gitignore b/spec/install/.gitignore index 12e42c958..8add3f42f 100644 --- a/spec/install/.gitignore +++ b/spec/install/.gitignore @@ -1,7 +1,3 @@ node_modules -typings -conf.js -browserts_spec.js -typescript_conf.js -typescript_spec.js npm-debug.log +tmp/ diff --git a/spec/install/conf.ts b/spec/install/conf.ts index 7e97068d6..cdb036b93 100644 --- a/spec/install/conf.ts +++ b/spec/install/conf.ts @@ -1,6 +1,6 @@ import {Config} from 'protractor'; -var env = require('../environment'); +var env = require('../../environment'); export let config: Config = { seleniumAddress: env.seleniumAddress, diff --git a/spec/ts/noCF/plugin_spec.ts b/spec/install/noCF/plugin_spec.ts similarity index 78% rename from spec/ts/noCF/plugin_spec.ts rename to spec/install/noCF/plugin_spec.ts index f9367b8e2..8f15bcc7a 100644 --- a/spec/ts/noCF/plugin_spec.ts +++ b/spec/install/noCF/plugin_spec.ts @@ -1,4 +1,4 @@ -import {browser, protractor} from '../../..'; +import {browser, protractor} from 'protractor'; describe('category', function() { it('name', async function() { diff --git a/spec/ts/noCF/smoke_spec.ts b/spec/install/noCF/smoke_spec.ts similarity index 99% rename from spec/ts/noCF/smoke_spec.ts rename to spec/install/noCF/smoke_spec.ts index 4477a1ccd..9a218893b 100644 --- a/spec/ts/noCF/smoke_spec.ts +++ b/spec/install/noCF/smoke_spec.ts @@ -1,7 +1,7 @@ // Based off of spec/basic/elements_spec.js import * as q from 'q'; -import {$, $$, browser, by, By, element, ElementArrayFinder, ElementFinder, ExpectedConditions, promise as ppromise, WebElement} from '../../..'; +import {$, $$, browser, by, By, element, ElementArrayFinder, ElementFinder, ExpectedConditions, promise as ppromise, WebElement} from 'protractor'; describe('verify control flow is off', function() { it('should have set webdriver.promise.USE_PROMISE_MANAGER', () => { diff --git a/spec/ts/noCFPluginConf.ts b/spec/install/noCFPluginConf.ts similarity index 87% rename from spec/ts/noCFPluginConf.ts rename to spec/install/noCFPluginConf.ts index bca23ec41..42bbfda96 100644 --- a/spec/ts/noCFPluginConf.ts +++ b/spec/install/noCFPluginConf.ts @@ -1,7 +1,7 @@ import * as q from 'q'; -import {Config, protractor} from '../..'; +import {Config, protractor} from 'protractor'; import {promise as wdpromise} from 'selenium-webdriver'; -const env = require('../environment.js'); +const env = require('../../environment'); export let config: Config = { seleniumAddress: env.seleniumAddress, diff --git a/spec/ts/noCFSmokeConf.ts b/spec/install/noCFSmokeConf.ts similarity index 86% rename from spec/ts/noCFSmokeConf.ts rename to spec/install/noCFSmokeConf.ts index f0bc5ef06..0e5cf1942 100644 --- a/spec/ts/noCFSmokeConf.ts +++ b/spec/install/noCFSmokeConf.ts @@ -1,5 +1,5 @@ import {Config} from '../..'; -const env = require('../environment.js'); +const env = require('../../environment'); export let config: Config = { seleniumAddress: env.seleniumAddress, diff --git a/spec/install/package.json b/spec/install/package.json index 020ffc572..3f4d2cfd4 100644 --- a/spec/install/package.json +++ b/spec/install/package.json @@ -4,15 +4,23 @@ "description": "e2e typescript => javascript => running", "main": "index.js", "scripts": { - "tsc": "node_modules/typescript/bin/tsc", - "test": "protractor conf.js" + "tsc": "tsc", + "test": "protractor tmp/conf.js" }, "author": "", "license": "MIT", "dependencies": { "@types/jasmine": "^2.5.38", + "@types/selenium-webdriver": "^2.53.39", "protractor": "file:../../", + "q": "^1.4.1", "rimraf": "^2.5.4", - "typescript": "^2.1.1" + "selenium-webdriver": "^3.0.1", + "typescript": "~2.0.0" + }, + "devDependencies": { + "@types/jasmine": "^2.5.41", + "@types/jasminewd2": "^2.0.0", + "@types/q": "0.0.32" } } diff --git a/spec/install/test.js b/spec/install/test.js index 7021aac1f..f0e56b5a8 100644 --- a/spec/install/test.js +++ b/spec/install/test.js @@ -60,5 +60,7 @@ function test(file) { install(); tsc(); -test('conf.js'); -test('typescript_conf.js'); +test('tmp/conf.js'); +test('tmp/typescript_conf.js'); +test('tmp/noCFSmokeConf.js'); +test('tmp/noCFPluginConf.js'); diff --git a/spec/install/tsconfig.json b/spec/install/tsconfig.json index c752f8b29..06128a465 100644 --- a/spec/install/tsconfig.json +++ b/spec/install/tsconfig.json @@ -6,7 +6,8 @@ "sourceMap": false, "declaration": false, "noImplicitAny": false, - "types": ["node", "jasmine"] + "types": ["node", "jasmine"], + "outDir": "tmp" }, "exclude": [ "node_modules", diff --git a/ts_spec_config.json b/spec/tsconfig.json similarity index 90% rename from ts_spec_config.json rename to spec/tsconfig.json index e460c7a5a..eb8af8c8e 100644 --- a/ts_spec_config.json +++ b/spec/tsconfig.json @@ -7,7 +7,7 @@ "declaration": true, "removeComments": false, "noImplicitAny": true, - "outDir": "spec/built", + "outDir": "built", "types": [ "jasmine", "jasminewd2", "node", "chalk", "glob", "minimatch", @@ -16,6 +16,6 @@ ] }, "include": [ - "spec/ts" + "ts" ] } diff --git a/tsconfig.json b/tsconfig.json index 554d8c9ec..4cc9124c4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,6 +16,6 @@ "website", "scripts", "exampleTypescript", - "spec" + "spec/install" ] }