-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
3,418 additions
and
281 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
'use strict'; | ||
|
||
function jsonReporter(results) { | ||
let started = false; | ||
|
||
results.on('start', function () { | ||
console.log('['); | ||
}); | ||
|
||
results.on('end', function () { | ||
console.log(']'); | ||
}); | ||
|
||
results.on('test end', function (test) { | ||
if (started) { | ||
process.stdout.write(','); | ||
} else { | ||
started = true; | ||
} | ||
|
||
console.log(JSON.stringify(test)); | ||
}); | ||
} | ||
|
||
module.exports = jsonReporter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
/*--- | ||
description: Async test | ||
note: Will only work in hosts with setTimeout... | ||
expected: | ||
pass: true | ||
---*/ | ||
|
||
process.nextTick(function() { | ||
$DONE() | ||
}) | ||
var p = new Promise(function(resolve) { | ||
resolve(); | ||
}); | ||
|
||
p.then($DONE, $DONE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
/*--- | ||
description: Async test | ||
negative: RangeError | ||
expected: | ||
pass: true | ||
---*/ | ||
|
||
process.nextTick(function() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
/*--- | ||
description: Fails by calling $ERROR | ||
expected: | ||
pass: false | ||
message: failure message | ||
---*/ | ||
|
||
$ERROR('failure message'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
/*--- | ||
description: Should report the expected error indicated by the "negative" frontmatter | ||
negative: ExpectedError | ||
expected: | ||
pass: false | ||
---*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
/*--- | ||
description: Should not test in strict mode | ||
flags: [noStrict] | ||
expected: | ||
pass: true | ||
---*/ | ||
x = 5; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
//Date_constants.js | ||
// Copyright 2009 the Sputnik authors. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
var HoursPerDay = 24; | ||
var MinutesPerHour = 60; | ||
var SecondsPerMinute = 60; | ||
|
||
var msPerDay = 86400000; | ||
var msPerSecond = 1000; | ||
var msPerMinute = 60000; | ||
var msPerHour = 3600000; | ||
|
||
var date_1899_end = -2208988800001; | ||
var date_1900_start = -2208988800000; | ||
var date_1969_end = -1; | ||
var date_1970_start = 0; | ||
var date_1999_end = 946684799999; | ||
var date_2000_start = 946684800000; | ||
var date_2099_end = 4102444799999; | ||
var date_2100_start = 4102444800000; | ||
|
||
// Copyright 2009 the Sputnik authors. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
//the following values are normally generated by the sputnik.py driver | ||
var $LocalTZ, | ||
$DST_start_month, | ||
$DST_start_sunday, | ||
$DST_start_hour, | ||
$DST_start_minutes, | ||
$DST_end_month, | ||
$DST_end_sunday, | ||
$DST_end_hour, | ||
$DST_end_minutes; | ||
|
||
(function () { | ||
/** | ||
* Finds the first date, starting from |start|, where |predicate| | ||
* holds. | ||
*/ | ||
var findNearestDateBefore = function(start, predicate) { | ||
var current = start; | ||
var month = 1000 * 60 * 60 * 24 * 30; | ||
for (var step = month; step > 0; step = Math.floor(step / 3)) { | ||
if (!predicate(current)) { | ||
while (!predicate(current)) | ||
current = new Date(current.getTime() + step); | ||
current = new Date(current.getTime() - step); | ||
} | ||
} | ||
while (!predicate(current)) { | ||
current = new Date(current.getTime() + 1); | ||
} | ||
return current; | ||
}; | ||
|
||
var juneDate = new Date(2000, 5, 20, 0, 0, 0, 0); | ||
var decemberDate = new Date(2000, 11, 20, 0, 0, 0, 0); | ||
var juneOffset = juneDate.getTimezoneOffset(); | ||
var decemberOffset = decemberDate.getTimezoneOffset(); | ||
var isSouthernHemisphere = (juneOffset > decemberOffset); | ||
var winterTime = isSouthernHemisphere ? juneDate : decemberDate; | ||
var summerTime = isSouthernHemisphere ? decemberDate : juneDate; | ||
|
||
var dstStart = findNearestDateBefore(winterTime, function (date) { | ||
return date.getTimezoneOffset() == summerTime.getTimezoneOffset(); | ||
}); | ||
$DST_start_month = dstStart.getMonth(); | ||
$DST_start_sunday = dstStart.getDate() > 15 ? '"last"' : '"first"'; | ||
$DST_start_hour = dstStart.getHours(); | ||
$DST_start_minutes = dstStart.getMinutes(); | ||
|
||
var dstEnd = findNearestDateBefore(summerTime, function (date) { | ||
return date.getTimezoneOffset() == winterTime.getTimezoneOffset(); | ||
}); | ||
$DST_end_month = dstEnd.getMonth(); | ||
$DST_end_sunday = dstEnd.getDate() > 15 ? '"last"' : '"first"'; | ||
$DST_end_hour = dstEnd.getHours(); | ||
$DST_end_minutes = dstEnd.getMinutes(); | ||
|
||
return; | ||
})(); |
Oops, something went wrong.