Skip to content

Commit

Permalink
Add test for previous change.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kami committed May 4, 2011
1 parent 7472955 commit 1117ef2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
23 changes: 23 additions & 0 deletions example/test-timeout-after-finish.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Licensed to Cloudkick, Inc ('Cloudkick') under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* Cloudkick licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

exports['test_timeout_after_finish'] = function(test, assert) {
test.finish();
setTimeout(function() {
assert.ok(false);
}, 50000);
};
10 changes: 10 additions & 0 deletions test/simple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,14 @@ else
echo 'jscoverage not installed, skipping coverage tests'
fi

# Make sure that the child which blocks after call .finish() is killed and
# timeout properly reported
"${CWD}/bin/whiskey" --timeout 1000 \
--tests "${CWD}/example/est-timeout-after-finish.js"

if [ $? -ne 1 ]; then
echo "1 test should timeout"
exit 1
fi

exit 0

0 comments on commit 1117ef2

Please sign in to comment.