test (backend-rs): remove ava in favor of cargo test

This commit is contained in:
naskya 2024-04-27 11:23:16 +09:00
parent 28b9e35f2a
commit cc560811cf
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C
4 changed files with 20 additions and 620 deletions

View file

@ -1,12 +0,0 @@
target
Cargo.lock
.cargo
.github
npm
.eslintrc
rustfmt.toml
yarn.lock
*.node
.yarn
__test__
renovate.json

View file

@ -1,32 +0,0 @@
import test from "ava";
import {
convertId,
IdConvertType,
nativeInitIdGenerator,
nativeCreateId,
nativeRandomStr,
} from "../built/index.js";
test("convert to mastodon id", (t) => {
t.is(convertId("9gf61ehcxv", IdConvertType.MastodonId), "960365976481219");
t.is(
convertId("9fbr9z0wbrjqyd3u", IdConvertType.MastodonId),
"2083785058661759970208986",
);
t.is(
convertId("9fbs680oyviiqrol9md73p8g", IdConvertType.MastodonId),
"5878598648988104013828532260828151168",
);
});
test("create cuid2 with timestamp prefix", (t) => {
nativeInitIdGenerator(16, "");
t.not(nativeCreateId(Date.now()), nativeCreateId(Date.now()));
t.is(nativeCreateId(Date.now()).length, 16);
});
test("create random string", (t) => {
t.not(nativeRandomStr(16), nativeRandomStr(16));
t.is(nativeRandomStr(24).length, 24);
});

View file

@ -22,11 +22,7 @@
}
},
"devDependencies": {
"@napi-rs/cli": "2.18.1",
"ava": "6.1.2"
},
"ava": {
"timeout": "3m"
"@napi-rs/cli": "2.18.1"
},
"engines": {
"node": ">= 10"
@ -36,11 +32,7 @@
"build": "napi build --features napi --no-const-enum --platform --release ./built/",
"build:debug": "napi build --features napi --no-const-enum --platform ./built/",
"prepublishOnly": "napi prepublish -t npm",
"test": "pnpm run cargo:test && pnpm run build:debug && ava",
"universal": "napi universal",
"version": "napi version",
"cargo:test": "pnpm run cargo:unit && pnpm run cargo:integration",
"cargo:unit": "cargo test unit_test && cargo test -F napi unit_test",
"cargo:integration": "cargo test int_test"
"version": "napi version"
}
}

File diff suppressed because it is too large Load diff