Skip to content

Commit

Permalink
No need for specific time zone in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lahma committed Mar 25, 2022
1 parent 6ebcfbb commit 7e17da6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 22 deletions.
5 changes: 0 additions & 5 deletions Jint.Tests.Test262/State.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,4 @@ public static partial class State
/// Pre-compiled scripts for faster execution.
/// </summary>
public static readonly Dictionary<string, Script> Sources = new(StringComparer.OrdinalIgnoreCase);

/// <summary>
/// Time zone to use by default.
/// </summary>
public static TimeZoneInfo TimeZone;
}
3 changes: 0 additions & 3 deletions Jint.Tests.Test262/Test262Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ private Engine BuildTestExecutor(Test262File file)
{
var engine = new Engine(cfg =>
{
cfg
.LocalTimeZone(State.TimeZone);
var relativePath = Path.GetDirectoryName(file.FileName);
cfg.EnableModules(new Test262ModuleLoader(State.Test262Stream.Options.FileSystem, relativePath));
});
Expand Down
15 changes: 1 addition & 14 deletions Jint.Tests.Test262/TestHarness.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.IO;
using System.Threading.Tasks;

Expand All @@ -13,18 +12,6 @@ public partial class TestHarness
{
private static partial Task InitializeCustomState()
{
// NOTE: The Date tests in test262 assume the local timezone is Pacific Standard Time
try
{
State.TimeZone = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time");
}
catch (TimeZoneNotFoundException)
{
// https://stackoverflow.com/questions/47848111/how-should-i-fetch-timezoneinfo-in-a-platform-agnostic-way
// should be natively supported soon https://github.com/dotnet/runtime/issues/18644
State.TimeZone = TimeZoneInfo.FindSystemTimeZoneById("America/Los_Angeles");
}

foreach (var file in State.HarnessFiles)
{
var source = file.Program;
Expand All @@ -33,4 +20,4 @@ public partial class TestHarness

return Task.CompletedTask;
}
}
}

0 comments on commit 7e17da6

Please sign in to comment.