From abd8b77106fee05bd705235a1c68b1748b0c9d08 Mon Sep 17 00:00:00 2001 From: Rich-Harris Date: Mon, 21 Nov 2016 16:41:47 -0500 Subject: [PATCH] test custom events --- test/compiler/events-custom/_config.js | 19 +++++++++++++++++++ test/compiler/events-custom/main.html | 1 + 2 files changed, 20 insertions(+) create mode 100644 test/compiler/events-custom/_config.js create mode 100644 test/compiler/events-custom/main.html diff --git a/test/compiler/events-custom/_config.js b/test/compiler/events-custom/_config.js new file mode 100644 index 0000000000..226fc3534f --- /dev/null +++ b/test/compiler/events-custom/_config.js @@ -0,0 +1,19 @@ +import * as assert from 'assert'; + +export default { + test ( component ) { + let count = 0; + + const expected = { x: 1 }; + + component.on( 'foo', data => { + assert.equal( data, expected ); + count += 1; + }); + + component.fire( 'foo', expected ); + assert.equal( count, 1 ); + + component.teardown(); + } +}; diff --git a/test/compiler/events-custom/main.html b/test/compiler/events-custom/main.html new file mode 100644 index 0000000000..7c89b545c5 --- /dev/null +++ b/test/compiler/events-custom/main.html @@ -0,0 +1 @@ +