protractor
Advanced tools
Comparing version 4.0.5 to 4.0.6
@@ -9,3 +9,4 @@ { | ||
"noImplicitAny": false, | ||
"outDir": "tmp" | ||
"outDir": "tmp", | ||
"types": ["node", "jasmine"] | ||
}, | ||
@@ -12,0 +13,0 @@ "exclude": [ |
@@ -8,2 +8,3 @@ 'use strict'; | ||
var spawn = require('child_process').spawn; | ||
var spawnSync = require('child_process').spawnSync; | ||
var fs = require('fs'); | ||
@@ -36,4 +37,28 @@ var path = require('path'); | ||
// prevent contributors from using the wrong version of node | ||
gulp.task('checkVersion', function(done) { | ||
var version = spawnSync('node', ['--version']).stdout.toString(); | ||
var versionArray = version.replace('v', '').split('.'); | ||
var major = versionArray[0]; | ||
var minor = versionArray[1]; | ||
// read minimum node on package.json | ||
var packageJson = JSON.parse(fs.readFileSync(path.resolve('package.json'))); | ||
var protractorVersion = packageJson.version; | ||
var nodeVersion = packageJson.engines.node.replace('>=',''); | ||
var nodeVersionArray = nodeVersion.split('.'); | ||
var requiredMajor = nodeVersionArray[0]; | ||
var requiredMinor = nodeVersionArray[1]; | ||
if (major >= requiredMajor && minor >= requiredMinor) { | ||
done(); | ||
} else { | ||
console.error('minimum node version for Protractor ' + protractorVersion + | ||
' is node >= ' + nodeVersion); | ||
return 1; | ||
} | ||
}); | ||
gulp.task('built:copy', function() { | ||
return gulp.src(['lib/**/*','!lib/**/*.ts']) | ||
return gulp.src(['lib/**/*.js','lib/globals.d.ts']) | ||
.pipe(gulp.dest('built/')); | ||
@@ -52,5 +77,5 @@ }); | ||
gulp.task('format:enforce', () => { | ||
const format = require('gulp-clang-format'); | ||
const clangFormat = require('clang-format'); | ||
gulp.task('format:enforce', function() { | ||
var format = require('gulp-clang-format'); | ||
var clangFormat = require('clang-format'); | ||
return gulp.src(['lib/**/*.ts']).pipe( | ||
@@ -60,5 +85,5 @@ format.checkFormat('file', clangFormat, {verbose: true, fail: true})); | ||
gulp.task('format', () => { | ||
const format = require('gulp-clang-format'); | ||
const clangFormat = require('clang-format'); | ||
gulp.task('format', function() { | ||
var format = require('gulp-clang-format'); | ||
var clangFormat = require('clang-format'); | ||
return gulp.src(['lib/**/*.ts'], { base: '.' }).pipe( | ||
@@ -78,3 +103,3 @@ format.format('file', clangFormat)).pipe(gulp.dest('.')); | ||
gulp.task('prepublish', function(done) { | ||
runSequence(['jshint', 'format'], 'tsc', 'tsc:globals', 'types', | ||
runSequence('checkVersion', ['jshint', 'format'], 'tsc', 'tsc:globals', 'types', | ||
'ambient', 'built:copy', done); | ||
@@ -84,3 +109,3 @@ }); | ||
gulp.task('pretest', function(done) { | ||
runSequence( | ||
runSequence('checkVersion', | ||
['webdriver:update', 'jshint', 'format'], 'tsc', 'tsc:globals', | ||
@@ -98,7 +123,6 @@ 'types', 'ambient', 'built:copy', done); | ||
var contents = ''; | ||
contents += '/// <reference path="../../@types/node/index.d.ts" />\n'; | ||
contents += '/// <reference path="../../@types/jasmine/index.d.ts" />\n'; | ||
contents += '/// <reference path="../typings/index.d.ts" />\n'; | ||
contents += '/// <reference path="./globals.d.ts" />\n'; | ||
contents += 'import {ActionSequence, By, WebDriver, WebElement, WebElementPromise, promise, promise as wdpromise, until} from \'selenium-webdriver\';\n'; | ||
files.forEach(file => { | ||
files.forEach(function(file) { | ||
contents += parseTypingsFile(folder, file); | ||
@@ -108,3 +132,3 @@ }); | ||
// remove files with d.ts | ||
glob.sync(folder + '/**/*.d.ts').forEach(file => { | ||
glob.sync(folder + '/**/*.d.ts').forEach(function(file) { | ||
fs.unlinkSync(path.resolve(file)); | ||
@@ -122,3 +146,3 @@ }); | ||
fileContents = fileContents.replace( | ||
/webdriver.promise.Promise<\{[a-zA-Z:,; \n]+\}>/g, (type) => { | ||
/webdriver.promise.Promise<\{[a-zA-Z:,; \n]+\}>/g, function(type) { | ||
return type.replace(/\n/g, ''); | ||
@@ -125,0 +149,0 @@ } |
@@ -20,3 +20,3 @@ { | ||
"glob": "^7.0.3", | ||
"jasmine": "2.4.1", | ||
"jasmine": "^2.5.0", | ||
"jasminewd2": "0.0.10", | ||
@@ -36,3 +36,3 @@ "optimist": "~0.6.0", | ||
"@types/optimist": "0.0.28", | ||
"@types/q": "0.0.29", | ||
"@types/q": "^0.0.30", | ||
"body-parser": "~1.15.2", | ||
@@ -74,3 +74,6 @@ "chai": "~3.5.0", | ||
"license": "MIT", | ||
"version": "4.0.5" | ||
"engines": { | ||
"node": ">=4.2.x" | ||
}, | ||
"version": "4.0.6" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19464
927347
73
8
+ Addedjasmine@2.99.0(transitive)
+ Addedjasmine-core@2.99.1(transitive)
- Removedglob@3.2.11(transitive)
- Removedjasmine@2.4.1(transitive)
- Removedjasmine-core@2.4.1(transitive)
- Removedlru-cache@2.7.3(transitive)
- Removedminimatch@0.3.0(transitive)
- Removedsigmund@1.0.1(transitive)
Updatedjasmine@^2.5.0