chore: move test_ffi and test_nap to tests/ [WIP] (#22394)

Moving some additional NAPI and. FFI tests out of the tree root.
This commit is contained in:
Matt Mastracci 2024-02-12 13:46:50 -07:00 committed by GitHub
parent bd1358efab
commit f60720090c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
71 changed files with 66 additions and 24 deletions

17
tests/napi/date_test.js Normal file
View file

@ -0,0 +1,17 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assertEquals, loadTestLibrary } from "./common.js";
const date = loadTestLibrary();
Deno.test("napi date", function () {
const dateTypeTestDate = date.createDate(1549183351);
assertEquals(date.isDate(dateTypeTestDate), true);
assertEquals(date.isDate(new Date(1549183351)), true);
assertEquals(date.isDate(2.4), false);
assertEquals(date.isDate("not a date"), false);
assertEquals(date.isDate(undefined), false);
assertEquals(date.isDate(null), false);
assertEquals(date.isDate({}), false);
assertEquals(date.getDateValue(new Date(1549183351)), 1549183351);
});