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:
commit
15a127c1b9
4 changed files with 5 additions and 0 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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),*]);
|
||||
|
|
Loading…
Reference in a new issue