From d6962b3ff10857d2465ce1cde989e49927b068b7 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Wed, 1 Mar 2017 11:57:41 -0500 Subject: [PATCH] use component.destroy() in tests instead of component.teardown() --- test/formats.js | 6 +++--- test/generate.js | 2 +- test/generator/binding-select-initial-value/_config.js | 2 +- test/generator/component-binding-each-nested/_config.js | 2 +- test/generator/component-binding-each/_config.js | 2 +- test/generator/component-events-each/_config.js | 2 +- test/generator/component-yield-multiple-in-if/_config.js | 2 +- test/generator/computed-values-default/_config.js | 2 +- test/generator/computed-values/_config.js | 2 +- test/generator/deconflict-builtins/_config.js | 2 +- test/generator/destructuring/_config.js | 2 +- test/generator/each-block-keyed/_config.js | 2 +- test/generator/events-custom/_config.js | 2 +- test/generator/events-lifecycle/_config.js | 2 +- test/generator/hello-world/_config.js | 2 +- test/generator/if-block-elseif-text/_config.js | 2 +- test/generator/if-block-elseif/_config.js | 2 +- test/generator/lifecycle-events/_config.js | 2 +- test/generator/onrender-chain/_config.js | 2 +- test/generator/onrender-fires-when-ready/_config.js | 2 +- test/generator/raw-mustaches-preserved/_config.js | 2 +- test/generator/raw-mustaches/_config.js | 2 +- test/generator/select/_config.js | 2 +- test/generator/set-in-observe-dedupes-renders/_config.js | 2 +- test/generator/svg-attributes/_config.js | 2 +- test/generator/svg-class/_config.js | 2 +- test/generator/svg-each-block-namespace/_config.js | 2 +- test/generator/svg-xlink/_config.js | 2 +- 28 files changed, 30 insertions(+), 30 deletions(-) diff --git a/test/formats.js b/test/formats.js index a712c4b7a4..9b803cadcc 100644 --- a/test/formats.js +++ b/test/formats.js @@ -17,7 +17,7 @@ function testAmd ( code, expectedId, dependencies, html ) { assert.htmlEqual( main.innerHTML, html ); - component.teardown(); + component.destroy(); } define.amd = true; @@ -44,7 +44,7 @@ function testCjs ( code, dependencyById, html ) { assert.htmlEqual( main.innerHTML, html ); - component.teardown(); + component.destroy(); }); } @@ -59,7 +59,7 @@ function testIife ( code, name, globals, html ) { assert.htmlEqual( main.innerHTML, html ); - component.teardown(); + component.destroy(); }); } diff --git a/test/generate.js b/test/generate.js index 7adba3c61d..1f5bafcd01 100644 --- a/test/generate.js +++ b/test/generate.js @@ -98,7 +98,7 @@ describe( 'generate', () => { if ( config.test ) { config.test( assert, component, target, window ); } else { - component.teardown(); + component.destroy(); assert.equal( target.innerHTML, '' ); } }) diff --git a/test/generator/binding-select-initial-value/_config.js b/test/generator/binding-select-initial-value/_config.js index b49c1135af..f6b685fd7e 100644 --- a/test/generator/binding-select-initial-value/_config.js +++ b/test/generator/binding-select-initial-value/_config.js @@ -24,6 +24,6 @@ export default { assert.equal( select.value, 'b' ); assert.ok( options[1].selected ); - component.teardown(); + component.destroy(); } }; diff --git a/test/generator/component-binding-each-nested/_config.js b/test/generator/component-binding-each-nested/_config.js index ab5cbef585..536996e869 100644 --- a/test/generator/component-binding-each-nested/_config.js +++ b/test/generator/component-binding-each-nested/_config.js @@ -17,6 +17,6 @@ export default {

blah, bar, baz

` ); - component.teardown(); + component.destroy(); } }; diff --git a/test/generator/component-binding-each/_config.js b/test/generator/component-binding-each/_config.js index 3cb8d05bc9..d42460aff0 100644 --- a/test/generator/component-binding-each/_config.js +++ b/test/generator/component-binding-each/_config.js @@ -17,6 +17,6 @@ export default {

blah, bar, baz

` ); - component.teardown(); + component.destroy(); } }; diff --git a/test/generator/component-events-each/_config.js b/test/generator/component-events-each/_config.js index 25635556a0..e7efe6fbff 100644 --- a/test/generator/component-events-each/_config.js +++ b/test/generator/component-events-each/_config.js @@ -22,6 +22,6 @@ export default { buttons[2].dispatchEvent( event ); assert.deepEqual( clicks, [ 'a', 'c' ]); - component.teardown(); + component.destroy(); } }; diff --git a/test/generator/component-yield-multiple-in-if/_config.js b/test/generator/component-yield-multiple-in-if/_config.js index 58e0ecfabc..1460962e7a 100644 --- a/test/generator/component-yield-multiple-in-if/_config.js +++ b/test/generator/component-yield-multiple-in-if/_config.js @@ -7,6 +7,6 @@ export default { component.set({ arriving: false }); assert.htmlEqual( target.innerHTML, `

Goodbye

` ); - component.teardown(); + component.destroy(); } }; diff --git a/test/generator/computed-values-default/_config.js b/test/generator/computed-values-default/_config.js index 9d761d8915..63db59a8a3 100644 --- a/test/generator/computed-values-default/_config.js +++ b/test/generator/computed-values-default/_config.js @@ -4,6 +4,6 @@ export default { test ( assert, component, target ) { component.set({ a: 2 }); assert.equal( target.innerHTML, '

4

' ); - component.teardown(); + component.destroy(); } }; diff --git a/test/generator/computed-values/_config.js b/test/generator/computed-values/_config.js index b5f7112fa8..8425cba4ff 100644 --- a/test/generator/computed-values/_config.js +++ b/test/generator/computed-values/_config.js @@ -5,6 +5,6 @@ export default { assert.equal( component.get( 'c' ), 5 ); assert.equal( component.get( 'cSquared' ), 25 ); assert.equal( target.innerHTML, '

3 + 2 = 5

\n

5 * 5 = 25

' ); - component.teardown(); + component.destroy(); } }; diff --git a/test/generator/deconflict-builtins/_config.js b/test/generator/deconflict-builtins/_config.js index 14927e7ad3..5ad7a44210 100644 --- a/test/generator/deconflict-builtins/_config.js +++ b/test/generator/deconflict-builtins/_config.js @@ -3,6 +3,6 @@ export default { test ( assert, component ) { assert.equal( component.get( 'foo' ), 'got' ); - component.teardown(); + component.destroy(); } }; \ No newline at end of file diff --git a/test/generator/destructuring/_config.js b/test/generator/destructuring/_config.js index f8a46d1810..77308e36b1 100644 --- a/test/generator/destructuring/_config.js +++ b/test/generator/destructuring/_config.js @@ -22,6 +22,6 @@ export default { assert.equal( count, 1 ); assert.equal( number, 42 ); - component.teardown(); + component.destroy(); } }; \ No newline at end of file diff --git a/test/generator/each-block-keyed/_config.js b/test/generator/each-block-keyed/_config.js index 094c2f1066..35b47f5be8 100644 --- a/test/generator/each-block-keyed/_config.js +++ b/test/generator/each-block-keyed/_config.js @@ -23,6 +23,6 @@ export default { assert.ok( !target.contains( p1 ), 'first

element should be removed' ); assert.equal( p2, p3, 'second

element should be retained' ); - component.teardown(); + component.destroy(); } }; diff --git a/test/generator/events-custom/_config.js b/test/generator/events-custom/_config.js index ed86a9300d..9fe6bbb6c7 100644 --- a/test/generator/events-custom/_config.js +++ b/test/generator/events-custom/_config.js @@ -12,6 +12,6 @@ export default { component.fire( 'foo', expected ); assert.equal( count, 1 ); - component.teardown(); + component.destroy(); } }; diff --git a/test/generator/events-lifecycle/_config.js b/test/generator/events-lifecycle/_config.js index 3a9677fca1..3303728f51 100644 --- a/test/generator/events-lifecycle/_config.js +++ b/test/generator/events-lifecycle/_config.js @@ -7,7 +7,7 @@ export default { count += 1; }); - component.teardown(); + component.destroy(); assert.equal( count, 1 ); } }; diff --git a/test/generator/hello-world/_config.js b/test/generator/hello-world/_config.js index cc4f568358..49d6f03776 100644 --- a/test/generator/hello-world/_config.js +++ b/test/generator/hello-world/_config.js @@ -9,7 +9,7 @@ export default { component.set({ name: 'everybody' }); assert.htmlEqual( target.innerHTML, '

Hello everybody!

' ); - component.teardown(); + component.destroy(); assert.htmlEqual( target.innerHTML, '' ); } }; diff --git a/test/generator/if-block-elseif-text/_config.js b/test/generator/if-block-elseif-text/_config.js index 9ddec8563a..89c8b011a9 100644 --- a/test/generator/if-block-elseif-text/_config.js +++ b/test/generator/if-block-elseif-text/_config.js @@ -18,6 +18,6 @@ export default { before-else-after ` ); - component.teardown(); + component.destroy(); } }; diff --git a/test/generator/if-block-elseif/_config.js b/test/generator/if-block-elseif/_config.js index 50f6b7eac9..ec24f3dd94 100644 --- a/test/generator/if-block-elseif/_config.js +++ b/test/generator/if-block-elseif/_config.js @@ -18,6 +18,6 @@ export default {

x is between 5 and 10

` ); - component.teardown(); + component.destroy(); } }; diff --git a/test/generator/lifecycle-events/_config.js b/test/generator/lifecycle-events/_config.js index 457d888b06..3dcb0d5192 100644 --- a/test/generator/lifecycle-events/_config.js +++ b/test/generator/lifecycle-events/_config.js @@ -1,7 +1,7 @@ export default { test ( assert, component ) { assert.deepEqual( component.events, [ 'render' ]); - component.teardown(); + component.destroy(); assert.deepEqual( component.events, [ 'render', 'teardown' ]); } }; diff --git a/test/generator/onrender-chain/_config.js b/test/generator/onrender-chain/_config.js index cb3bab34a3..1bbf616117 100644 --- a/test/generator/onrender-chain/_config.js +++ b/test/generator/onrender-chain/_config.js @@ -12,6 +12,6 @@ export default { 12345 ` ); - component.teardown(); + component.destroy(); } }; diff --git a/test/generator/onrender-fires-when-ready/_config.js b/test/generator/onrender-fires-when-ready/_config.js index 5776e23915..d70d2c6e53 100644 --- a/test/generator/onrender-fires-when-ready/_config.js +++ b/test/generator/onrender-fires-when-ready/_config.js @@ -7,6 +7,6 @@ export default { component.set({ foo: true }); assert.htmlEqual( target.innerHTML, `

true

\n

true

` ); - component.teardown(); + component.destroy(); } }; diff --git a/test/generator/raw-mustaches-preserved/_config.js b/test/generator/raw-mustaches-preserved/_config.js index 698a58f911..4d3971d7e9 100644 --- a/test/generator/raw-mustaches-preserved/_config.js +++ b/test/generator/raw-mustaches-preserved/_config.js @@ -16,6 +16,6 @@ export default { assert.equal( target.innerHTML, `
${ns}

does not change

${ns}
` ); assert.strictEqual( target.querySelector( 'p' ), p ); - component.teardown(); + component.destroy(); } }; diff --git a/test/generator/raw-mustaches/_config.js b/test/generator/raw-mustaches/_config.js index 8b7767d6d1..22269ea975 100644 --- a/test/generator/raw-mustaches/_config.js +++ b/test/generator/raw-mustaches/_config.js @@ -14,7 +14,7 @@ export default { assert.equal( target.innerHTML, `before${ns}${ns}after` ); component.set({ raw: 'how about unclosed elements?' }); assert.equal( target.innerHTML, `before${ns}how about unclosed elements?${ns}after` ); - component.teardown(); + component.destroy(); assert.equal( target.innerHTML, '' ); } }; diff --git a/test/generator/select/_config.js b/test/generator/select/_config.js index e0023dea9e..8fffd0d25d 100644 --- a/test/generator/select/_config.js +++ b/test/generator/select/_config.js @@ -25,7 +25,7 @@ export default { assert.equal( target.querySelector( 'select' ).value, 'a' ); - component.teardown(); + component.destroy(); assert.htmlEqual( target.innerHTML, '' ); } }; diff --git a/test/generator/set-in-observe-dedupes-renders/_config.js b/test/generator/set-in-observe-dedupes-renders/_config.js index c86db923c0..776bfefc5d 100644 --- a/test/generator/set-in-observe-dedupes-renders/_config.js +++ b/test/generator/set-in-observe-dedupes-renders/_config.js @@ -3,6 +3,6 @@ export default { test ( assert, component ) { component.set({ foo: { x: 2 } }); - component.teardown(); + component.destroy(); } }; diff --git a/test/generator/svg-attributes/_config.js b/test/generator/svg-attributes/_config.js index 836f320a77..a14ad958ba 100644 --- a/test/generator/svg-attributes/_config.js +++ b/test/generator/svg-attributes/_config.js @@ -10,6 +10,6 @@ export default { test ( assert, component, target ) { const circle = target.querySelector( 'circle' ); assert.equal( circle.getAttribute( 'class' ), 'red' ); - component.teardown(); + component.destroy(); } }; diff --git a/test/generator/svg-class/_config.js b/test/generator/svg-class/_config.js index d801f4d602..74141d1679 100644 --- a/test/generator/svg-class/_config.js +++ b/test/generator/svg-class/_config.js @@ -9,6 +9,6 @@ export default { assert.equal( svg.namespaceURI, 'http://www.w3.org/2000/svg' ); assert.equal( svg.getAttribute( 'class' ), 'foo' ); - component.teardown(); + component.destroy(); } }; diff --git a/test/generator/svg-each-block-namespace/_config.js b/test/generator/svg-each-block-namespace/_config.js index eccd720c03..1bdab1a605 100644 --- a/test/generator/svg-each-block-namespace/_config.js +++ b/test/generator/svg-each-block-namespace/_config.js @@ -10,6 +10,6 @@ export default { assert.equal( circles[0].namespaceURI, 'http://www.w3.org/2000/svg' ); assert.equal( circles[1].namespaceURI, 'http://www.w3.org/2000/svg' ); assert.equal( circles[2].namespaceURI, 'http://www.w3.org/2000/svg' ); - component.teardown(); + component.destroy(); } }; diff --git a/test/generator/svg-xlink/_config.js b/test/generator/svg-xlink/_config.js index eb49f3a72a..55bb6440a7 100644 --- a/test/generator/svg-xlink/_config.js +++ b/test/generator/svg-xlink/_config.js @@ -14,6 +14,6 @@ export default { assert.equal( href.namespaceURI, 'http://www.w3.org/1999/xlink' ); - component.teardown(); + component.destroy(); } };