Skip to content

Commit 90bd727

Browse files
committed
remove tests that requires @std-proposal/temporal
This does not work on IE11 because of ES2015 syntax
1 parent 267eae7 commit 90bd727

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

test/readme.test.ts

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -28,41 +28,4 @@ describe("README", () => {
2828
deepStrictEqual(decode(encoded), object);
2929
});
3030
});
31-
32-
context("timestamp/temporal", () => {
33-
before(function() {
34-
if (typeof BigInt === "undefined") {
35-
this.skip();
36-
}
37-
});
38-
39-
it("overrides timestamp-ext with std-temporal", () => {
40-
const Instant = require("@std-proposal/temporal").Instant;
41-
42-
const extensionCodec = new ExtensionCodec();
43-
extensionCodec.register({
44-
type: EXT_TIMESTAMP,
45-
encode: (input: any) => {
46-
if (input instanceof Instant) {
47-
const sec = input.seconds;
48-
const nsec = Number(input.nanoseconds - BigInt(sec) * BigInt(1e9));
49-
return encodeTimeSpecToTimestamp({ sec, nsec });
50-
} else {
51-
return null;
52-
}
53-
},
54-
decode: (data: Uint8Array) => {
55-
const timeSpec = decodeTimestampToTimeSpec(data);
56-
const sec = BigInt(timeSpec.sec);
57-
const nsec = BigInt(timeSpec.nsec);
58-
return Instant.fromEpochNanoseconds(sec * BigInt(1e9) + nsec);
59-
},
60-
});
61-
62-
const instant = Instant.fromEpochMilliseconds(Date.now());
63-
const encoded = encode(instant, { extensionCodec });
64-
const decoded = decode(encoded, { extensionCodec });
65-
deepStrictEqual(decoded, instant);
66-
});
67-
});
6831
});

0 commit comments

Comments
 (0)