Skip to content

Commit e0270bf

Browse files
Fix bigint error messages test
1 parent 255b796 commit e0270bf

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

tests/tests/bigints.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,9 @@ pub enum EnumWithInlineStructWithBigInt {
6060

6161
#[test]
6262
fn test_bigint_types() {
63-
// TODO: Fix errors
64-
for_bigint_types!(T -> |name| assert_eq!(crate::ts::inline::<T>(&Typescript::default()).map_err(|e| e.to_string()), Err("Attempted to export \"\" but Specta configuration forbids exporting BigInt types (i64, u64, i128, u128) because we don't know if your se/deserializer supports it. You can change this behavior by editing your `ExportConfiguration`!\n".into())));
65-
for_bigint_types!(T -> |name| assert_eq!(crate::ts::inline::<T>(&Typescript::new()).map_err(|e| e.to_string()), Err("Attempted to export \"\" but Specta configuration forbids exporting BigInt types (i64, u64, i128, u128) because we don't know if your se/deserializer supports it. You can change this behavior by editing your `ExportConfiguration`!\n".into())));
66-
for_bigint_types!(T -> |name| assert_eq!(crate::ts::inline::<T>(&Typescript::new().bigint(BigIntExportBehavior::Fail)).map_err(|e| e.to_string()), Err("Attempted to export \"\" but Specta configuration forbids exporting BigInt types (i64, u64, i128, u128) because we don't know if your se/deserializer supports it. You can change this behavior by editing your `ExportConfiguration`!\n".into())));
63+
for_bigint_types!(T -> |name| assert_eq!(crate::ts::inline::<T>(&Typescript::default()).map_err(|e| e.to_string()), Err("Attempted to export \"\" but Specta configuration forbids exporting BigInt types (i64, u64, i128, u128) because we don't know if your se/deserializer supports it. If your using a serializer/deserializer that natively has support for BigInt types you can disable this warning by editing your `ExportConfiguration`!\n".into())));
64+
for_bigint_types!(T -> |name| assert_eq!(crate::ts::inline::<T>(&Typescript::new()).map_err(|e| e.to_string()), Err("Attempted to export \"\" but Specta configuration forbids exporting BigInt types (i64, u64, i128, u128) because we don't know if your se/deserializer supports it. If your using a serializer/deserializer that natively has support for BigInt types you can disable this warning by editing your `ExportConfiguration`!\n".into())));
65+
for_bigint_types!(T -> |name| assert_eq!(crate::ts::inline::<T>(&Typescript::new().bigint(BigIntExportBehavior::Fail)).map_err(|e| e.to_string()), Err("Attempted to export \"\" but Specta configuration forbids exporting BigInt types (i64, u64, i128, u128) because we don't know if your se/deserializer supports it. If your using a serializer/deserializer that natively has support for BigInt types you can disable this warning by editing your `ExportConfiguration`!\n".into())));
6766

6867
for_bigint_types!(T -> |name| assert_eq!(crate::ts::inline::<T>(&Typescript::new().bigint(BigIntExportBehavior::String)).map_err(|e| e.to_string()), Ok("string".into())));
6968
for_bigint_types!(T -> |name| assert_eq!(crate::ts::inline::<T>(&Typescript::new().bigint(BigIntExportBehavior::Number)).map_err(|e| e.to_string()), Ok("number".into())));
@@ -72,22 +71,22 @@ fn test_bigint_types() {
7271
// // // Check error messages are working correctly -> These tests second for `ExportPath` which is why they are so comprehensive
7372
assert_eq!(
7473
crate::ts::inline::<StructWithBigInt>(&Typescript::default()).map_err(|e| e.to_string()),
75-
Err("Attempted to export \"\" but Specta configuration forbids exporting BigInt types (i64, u64, i128, u128) because we don't know if your se/deserializer supports it. You can change this behavior by editing your `ExportConfiguration`!\n".into())
74+
Err("Attempted to export \"\" but Specta configuration forbids exporting BigInt types (i64, u64, i128, u128) because we don't know if your se/deserializer supports it. If your using a serializer/deserializer that natively has support for BigInt types you can disable this warning by editing your `ExportConfiguration`!\n".into())
7675
);
7776
assert_eq!(
7877
crate::ts::inline::<StructWithStructWithBigInt>(&Typescript::default())
7978
.map_err(|e| e.to_string()),
80-
Err("Attempted to export \"\" but Specta configuration forbids exporting BigInt types (i64, u64, i128, u128) because we don't know if your se/deserializer supports it. You can change this behavior by editing your `ExportConfiguration`!\n".into())
79+
Err("Attempted to export \"\" but Specta configuration forbids exporting BigInt types (i64, u64, i128, u128) because we don't know if your se/deserializer supports it. If your using a serializer/deserializer that natively has support for BigInt types you can disable this warning by editing your `ExportConfiguration`!\n".into())
8180
);
8281
assert_eq!(
8382
crate::ts::inline::<StructWithStructWithStructWithBigInt>(&Typescript::default())
8483
.map_err(|e| e.to_string()),
85-
Err("Attempted to export \"\" but Specta configuration forbids exporting BigInt types (i64, u64, i128, u128) because we don't know if your se/deserializer supports it. You can change this behavior by editing your `ExportConfiguration`!\n".into())
84+
Err("Attempted to export \"\" but Specta configuration forbids exporting BigInt types (i64, u64, i128, u128) because we don't know if your se/deserializer supports it. If your using a serializer/deserializer that natively has support for BigInt types you can disable this warning by editing your `ExportConfiguration`!\n".into())
8685
);
8786
assert_eq!(
8887
crate::ts::inline::<EnumWithStructWithStructWithBigInt>(&Typescript::default())
8988
.map_err(|e| e.to_string()),
90-
Err("Attempted to export \"\" but Specta configuration forbids exporting BigInt types (i64, u64, i128, u128) because we don't know if your se/deserializer supports it. You can change this behavior by editing your `ExportConfiguration`!\n".into())
89+
Err("Attempted to export \"\" but Specta configuration forbids exporting BigInt types (i64, u64, i128, u128) because we don't know if your se/deserializer supports it. If your using a serializer/deserializer that natively has support for BigInt types you can disable this warning by editing your `ExportConfiguration`!\n".into())
9190
);
9291
// TODO: This required `inline` to work better on `Option<T>`
9392
// assert_eq!(
@@ -99,11 +98,11 @@ fn test_bigint_types() {
9998
assert_eq!(
10099
crate::ts::inline::<EnumWithStructWithStructWithBigInt>(&Typescript::default())
101100
.map_err(|e| e.to_string()),
102-
Err("Attempted to export \"\" but Specta configuration forbids exporting BigInt types (i64, u64, i128, u128) because we don't know if your se/deserializer supports it. You can change this behavior by editing your `ExportConfiguration`!\n".into())
101+
Err("Attempted to export \"\" but Specta configuration forbids exporting BigInt types (i64, u64, i128, u128) because we don't know if your se/deserializer supports it. If your using a serializer/deserializer that natively has support for BigInt types you can disable this warning by editing your `ExportConfiguration`!\n".into())
103102
);
104103
assert_eq!(
105104
crate::ts::inline::<EnumWithInlineStructWithBigInt>(&Typescript::default())
106105
.map_err(|e| e.to_string()),
107-
Err("Attempted to export \"\" but Specta configuration forbids exporting BigInt types (i64, u64, i128, u128) because we don't know if your se/deserializer supports it. You can change this behavior by editing your `ExportConfiguration`!\n".into())
106+
Err("Attempted to export \"\" but Specta configuration forbids exporting BigInt types (i64, u64, i128, u128) because we don't know if your se/deserializer supports it. If your using a serializer/deserializer that natively has support for BigInt types you can disable this warning by editing your `ExportConfiguration`!\n".into())
108107
);
109108
}

0 commit comments

Comments
 (0)