From a4474c9a0025095f82d734a9d7230eace2f08ef8 Mon Sep 17 00:00:00 2001 From: Oleg Gaidarenko Date: Sat, 11 Jun 2016 10:30:12 +0300 Subject: [PATCH] Tests: Move promise/A+ adapters for tests to dedicated folder --- build/tasks/promises_aplus_tests.js | 10 +++++----- test/node_smoke_tests/.eslintrc | 3 +++ test/promises_aplus_adapters/.eslintrc | 7 +++++++ .../deferred.js} | 6 ++---- .../when.js} | 6 ++---- 5 files changed, 19 insertions(+), 13 deletions(-) create mode 100644 test/promises_aplus_adapters/.eslintrc rename test/{promises_aplus_adapter_deferred.js => promises_aplus_adapters/deferred.js} (76%) rename test/{promises_aplus_adapter_when.js => promises_aplus_adapters/when.js} (91%) diff --git a/build/tasks/promises_aplus_tests.js b/build/tasks/promises_aplus_tests.js index c4fb86d4c..a0118d1f0 100644 --- a/build/tasks/promises_aplus_tests.js +++ b/build/tasks/promises_aplus_tests.js @@ -5,19 +5,19 @@ module.exports = function( grunt ) { var spawnTest = require( "./lib/spawn_test.js" ); grunt.registerTask( "promises_aplus_tests", - [ "promises_aplus_tests_deferred", "promises_aplus_tests_when" ] ); + [ "promises_aplus_tests:deferred", "promises_aplus_tests:when" ] ); - grunt.registerTask( "promises_aplus_tests_deferred", function() { + grunt.registerTask( "promises_aplus_tests:deferred", function() { spawnTest( this.async(), "./node_modules/.bin/promises-aplus-tests", - "test/promises_aplus_adapter_deferred.js" + "test/promises_aplus_adapters/deferred.js" ); } ); - grunt.registerTask( "promises_aplus_tests_when", function() { + grunt.registerTask( "promises_aplus_tests:when", function() { spawnTest( this.async(), "./node_modules/.bin/promises-aplus-tests", - "test/promises_aplus_adapter_when.js" + "test/promises_aplus_adapters/when.js" ); } ); }; diff --git a/test/node_smoke_tests/.eslintrc b/test/node_smoke_tests/.eslintrc index 11368d984..282933c1a 100644 --- a/test/node_smoke_tests/.eslintrc +++ b/test/node_smoke_tests/.eslintrc @@ -2,6 +2,9 @@ "env": { "node": true }, + "parserOptions": { + "ecmaVersion": 6 + }, "extends": "../.eslintrc", "root": true } diff --git a/test/promises_aplus_adapters/.eslintrc b/test/promises_aplus_adapters/.eslintrc new file mode 100644 index 000000000..11368d984 --- /dev/null +++ b/test/promises_aplus_adapters/.eslintrc @@ -0,0 +1,7 @@ +{ + "env": { + "node": true + }, + "extends": "../.eslintrc", + "root": true +} diff --git a/test/promises_aplus_adapter_deferred.js b/test/promises_aplus_adapters/deferred.js similarity index 76% rename from test/promises_aplus_adapter_deferred.js rename to test/promises_aplus_adapters/deferred.js index c7440b969..31af16655 100644 --- a/test/promises_aplus_adapter_deferred.js +++ b/test/promises_aplus_adapters/deferred.js @@ -1,5 +1,3 @@ -/* jshint node: true */ - "use strict"; require( "jsdom" ).env( "", function( errors, window ) { @@ -8,9 +6,9 @@ require( "jsdom" ).env( "", function( errors, window ) { return; } - var jQuery = require( ".." )( window ); + var jQuery = require( "../../" )( window ); - exports.deferred = function() { + module.exports.deferred = function() { var deferred = jQuery.Deferred(); return { diff --git a/test/promises_aplus_adapter_when.js b/test/promises_aplus_adapters/when.js similarity index 91% rename from test/promises_aplus_adapter_when.js rename to test/promises_aplus_adapters/when.js index 0a5ec6756..adde1a13a 100644 --- a/test/promises_aplus_adapter_when.js +++ b/test/promises_aplus_adapters/when.js @@ -1,5 +1,3 @@ -/* jshint node: true */ - "use strict"; require( "jsdom" ).env( "", function( errors, window ) { @@ -8,9 +6,9 @@ require( "jsdom" ).env( "", function( errors, window ) { return; } - var jQuery = require( ".." )( window ); + var jQuery = require( "../../" )( window ); - exports.deferred = function() { + module.exports.deferred = function() { var adopted, promised, obj = { resolve: function() { -- 2.39.5