UNPKG

616 BJavaScriptView Raw
1'use strict';
2
3var grunt = require('../../lib/grunt');
4
5exports['event'] = function(test) {
6 test.expect(3);
7 grunt.event.on('test.foo', function(a, b, c) {
8 // This should get executed once (emit test.foo).
9 test.equals(a + b + c, '123', 'Should have received the correct arguments.');
10 });
11 grunt.event.on('test.*', function(a, b, c) {
12 // This should get executed twice (emit test.foo and test.bar).
13 test.equals(a + b + c, '123', 'Should have received the correct arguments.');
14 });
15 grunt.event.emit('test.foo', '1', '2', '3');
16 grunt.event.emit('test.bar', '1', '2', '3');
17 test.done();
18};