Merge pull request #906 from napi-rs/skip-register-in-test

fix(napi-derive): disable register logic in rust test
This commit is contained in:
LongYinan 2021-12-06 14:07:45 +08:00 committed by GitHub
commit 15a127c1b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 0 deletions

View file

@ -38,6 +38,7 @@ impl NapiConst {
}
#[allow(non_snake_case)]
#[allow(clippy::all)]
#[cfg(not(test))]
#[napi::bindgen_prelude::ctor]
fn #register_name() {
napi::bindgen_prelude::register_module_export(#js_mod_ident, #js_name_lit, #cb_name);

View file

@ -147,6 +147,7 @@ impl NapiEnum {
}
#[allow(non_snake_case)]
#[allow(clippy::all)]
#[cfg(not(test))]
#[napi::bindgen_prelude::ctor]
fn #register_name() {
napi::bindgen_prelude::register_module_export(#js_mod_ident, #js_name_lit, #callback_name);

View file

@ -327,6 +327,7 @@ impl NapiFn {
#[allow(clippy::all)]
#[allow(non_snake_case)]
#[cfg(not(test))]
#[napi::bindgen_prelude::ctor]
fn #module_register_name() {
napi::bindgen_prelude::register_module_export(#js_mod_ident, #js_name, #cb_name);

View file

@ -437,6 +437,7 @@ impl NapiStruct {
quote! {
#[allow(non_snake_case)]
#[allow(clippy::all)]
#[cfg(not(test))]
#[napi::bindgen_prelude::ctor]
fn #struct_register_name() {
napi::bindgen_prelude::register_class(#name_str, #js_mod_ident, #js_name, vec![#(#props),*]);
@ -506,6 +507,7 @@ impl NapiImpl {
use super::*;
#(#methods)*
#[cfg(not(test))]
#[napi::bindgen_prelude::ctor]
fn #register_name() {
napi::bindgen_prelude::register_class(#name_str, #js_mod_ident, #js_name, vec![#(#props),*]);