From 543ee2f87064741de7ebb5911e6bc119162051ed Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Wed, 1 Mar 2017 11:45:55 -0500 Subject: [PATCH] update tests --- src/validate/js/propValidators/ondestroy.js | 4 ++-- test/generator/component-ref/Widget.html | 2 +- test/generator/lifecycle-events/main.html | 4 ++-- test/generator/onrender-chain/Item.html | 2 +- .../onrender-fires-when-ready-nested/Widget.html | 2 +- .../generator/onrender-fires-when-ready-nested/_config.js | 2 +- test/generator/onrender-fires-when-ready/Widget.html | 2 +- test/generator/onrender-fires-when-ready/_config.js | 2 +- test/generator/set-in-observe-dedupes-renders/Widget.html | 2 +- test/generator/set-in-observe-dedupes-renders/main.html | 2 +- test/generator/set-in-observe/_config.js | 2 +- test/generator/set-in-observe/main.html | 2 +- test/generator/set-in-onrender/_config.js | 2 +- test/generator/set-in-onrender/main.html | 2 +- test/sourcemaps/script/input.html | 2 +- .../errors.json | 0 test/validator/oncreate-arrow-no-this/input.html | 5 +++++ .../errors.json | 2 +- .../input.html | 2 +- .../errors.json | 0 test/validator/ondestroy-arrow-no-this/input.html | 5 +++++ test/validator/ondestroy-arrow-this/errors.json | 8 ++++++++ .../input.html | 2 +- test/validator/onrender-arrow-no-this/input.html | 5 ----- test/validator/onteardown-arrow-no-this/input.html | 5 ----- test/validator/onteardown-arrow-this/errors.json | 8 -------- 26 files changed, 38 insertions(+), 38 deletions(-) rename test/validator/{onrender-arrow-no-this => oncreate-arrow-no-this}/errors.json (100%) create mode 100644 test/validator/oncreate-arrow-no-this/input.html rename test/validator/{onrender-arrow-this => oncreate-arrow-this}/errors.json (57%) rename test/validator/{onrender-arrow-this => oncreate-arrow-this}/input.html (77%) rename test/validator/{onteardown-arrow-no-this => ondestroy-arrow-no-this}/errors.json (100%) create mode 100644 test/validator/ondestroy-arrow-no-this/input.html create mode 100644 test/validator/ondestroy-arrow-this/errors.json rename test/validator/{onteardown-arrow-this => ondestroy-arrow-this}/input.html (75%) delete mode 100644 test/validator/onrender-arrow-no-this/input.html delete mode 100644 test/validator/onteardown-arrow-no-this/input.html delete mode 100644 test/validator/onteardown-arrow-this/errors.json diff --git a/src/validate/js/propValidators/ondestroy.js b/src/validate/js/propValidators/ondestroy.js index 7ce61e223d..3471034178 100644 --- a/src/validate/js/propValidators/ondestroy.js +++ b/src/validate/js/propValidators/ondestroy.js @@ -1,9 +1,9 @@ import usesThisOrArguments from '../utils/usesThisOrArguments.js'; -export default function onteardown ( validator, prop ) { +export default function ondestroy ( validator, prop ) { if ( prop.value.type === 'ArrowFunctionExpression' ) { if ( usesThisOrArguments( prop.value.body ) ) { - validator.error( `'onteardown' should be a function expression, not an arrow function expression`, prop.start ); + validator.error( `'ondestroy' should be a function expression, not an arrow function expression`, prop.start ); } } } diff --git a/test/generator/component-ref/Widget.html b/test/generator/component-ref/Widget.html index c5a462601a..c8cf786cc8 100644 --- a/test/generator/component-ref/Widget.html +++ b/test/generator/component-ref/Widget.html @@ -2,7 +2,7 @@ diff --git a/test/validator/onrender-arrow-this/errors.json b/test/validator/oncreate-arrow-this/errors.json similarity index 57% rename from test/validator/onrender-arrow-this/errors.json rename to test/validator/oncreate-arrow-this/errors.json index 5cc9b2c78d..06d020a4f8 100644 --- a/test/validator/onrender-arrow-this/errors.json +++ b/test/validator/oncreate-arrow-this/errors.json @@ -1,5 +1,5 @@ [{ - "message": "'onrender' should be a function expression, not an arrow function expression", + "message": "'oncreate' should be a function expression, not an arrow function expression", "pos": 29, "loc": { "line": 3, diff --git a/test/validator/onrender-arrow-this/input.html b/test/validator/oncreate-arrow-this/input.html similarity index 77% rename from test/validator/onrender-arrow-this/input.html rename to test/validator/oncreate-arrow-this/input.html index e4283e60ba..36d36b698d 100644 --- a/test/validator/onrender-arrow-this/input.html +++ b/test/validator/oncreate-arrow-this/input.html @@ -1,6 +1,6 @@ diff --git a/test/validator/ondestroy-arrow-this/errors.json b/test/validator/ondestroy-arrow-this/errors.json new file mode 100644 index 0000000000..98e176f58f --- /dev/null +++ b/test/validator/ondestroy-arrow-this/errors.json @@ -0,0 +1,8 @@ +[{ + "message": "'ondestroy' should be a function expression, not an arrow function expression", + "pos": 29, + "loc": { + "line": 3, + "column": 2 + } +}] diff --git a/test/validator/onteardown-arrow-this/input.html b/test/validator/ondestroy-arrow-this/input.html similarity index 75% rename from test/validator/onteardown-arrow-this/input.html rename to test/validator/ondestroy-arrow-this/input.html index ac2f1d7e8b..2f5df93962 100644 --- a/test/validator/onteardown-arrow-this/input.html +++ b/test/validator/ondestroy-arrow-this/input.html @@ -1,6 +1,6 @@ diff --git a/test/validator/onteardown-arrow-no-this/input.html b/test/validator/onteardown-arrow-no-this/input.html deleted file mode 100644 index a742898edb..0000000000 --- a/test/validator/onteardown-arrow-no-this/input.html +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/test/validator/onteardown-arrow-this/errors.json b/test/validator/onteardown-arrow-this/errors.json deleted file mode 100644 index 0596578b95..0000000000 --- a/test/validator/onteardown-arrow-this/errors.json +++ /dev/null @@ -1,8 +0,0 @@ -[{ - "message": "'onteardown' should be a function expression, not an arrow function expression", - "pos": 29, - "loc": { - "line": 3, - "column": 2 - } -}]