paid-services 7.0.2 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/package.json +9 -11
  3. package/test/actions/test_execute_email_action.js +13 -6
  4. package/test/actions/test_execute_inbox_action.js +14 -6
  5. package/test/actions/test_execute_sms_action.js +14 -7
  6. package/test/actions/test_inbox_action_arguments.js +14 -6
  7. package/test/actions/test_send_postmark_email.js +13 -6
  8. package/test/actions/test_send_twilio_sms.js +13 -6
  9. package/test/balanced/test_balanced_open_request.js +13 -6
  10. package/test/capacity/test_assemble_replacement_tx.js +13 -6
  11. package/test/capacity/test_capacity_change_requests.js +13 -6
  12. package/test/capacity/test_encode_change_request.js +13 -6
  13. package/test/capacity/test_encode_sign_capacity_response.js +13 -6
  14. package/test/capacity/test_fee_for_replacement.js +13 -6
  15. package/test/capacity/test_finalize_capacity_replacement.js +13 -6
  16. package/test/capacity/test_interim_replacement_psbt.js +13 -6
  17. package/test/capacity/test_is_open_witness_script.js +13 -6
  18. package/test/capacity/test_parse_accept_request.js +13 -6
  19. package/test/capacity/test_parse_capacity_change_request.js +13 -6
  20. package/test/capacity/test_parse_sign_capacity_request.js +6 -11
  21. package/test/capacity/test_witness_script_from_close_txs.js +6 -11
  22. package/test/client/test_arguments_for_schema.js +13 -6
  23. package/test/client/test_byte_limited_string.js +14 -7
  24. package/test/client/test_confirm_service_use.js +14 -6
  25. package/test/client/test_decode_nodes_record.js +13 -6
  26. package/test/client/test_decode_schema_fields.js +14 -7
  27. package/test/client/test_decode_schema_records.js +13 -6
  28. package/test/client/test_decode_urls_record.js +14 -6
  29. package/test/client/test_error_records_as_error.js +14 -6
  30. package/test/client/test_make_service_request.js +14 -6
  31. package/test/client/test_messages_as_response.js +14 -6
  32. package/test/client/test_messages_for_request.js +14 -6
  33. package/test/client/test_wait_for_response.js +14 -6
  34. package/test/config/test_is_activity_enabled.js +13 -6
  35. package/test/config/test_is_connect_enabled.js +13 -6
  36. package/test/config/test_is_email_configured.js +13 -6
  37. package/test/config/test_is_invoice_enabled.js +13 -6
  38. package/test/config/test_is_sms_configured.js +13 -6
  39. package/test/config/test_validate_server_config.js +13 -6
  40. package/test/integration/test_accept_capacity_change.js +7 -9
  41. package/test/integration/test_change_channel_capacity.js +5 -5
  42. package/test/integration/test_decrease_channel_capacity.js +5 -5
  43. package/test/integration/test_fanout.js +21 -19
  44. package/test/integration/test_group.js +12 -12
  45. package/test/integration/test_group_noninteractive.js +5 -8
  46. package/test/integration/test_group_pair.js +10 -10
  47. package/test/integration/test_group_sort.js +16 -17
  48. package/test/integration/test_increase_channel_capacity.js +5 -5
  49. package/test/integration/test_move_channel_capacity.js +5 -5
  50. package/test/integration/test_request_swap_out.js +7 -7
  51. package/test/integration/test_service_peer_requests.js +8 -7
  52. package/test/integration/test_sign_capacity_replacement.js +6 -6
  53. package/test/integration/test_split_channel_capacity.js +5 -5
  54. package/test/integration/test_swap_with_claim_path.js +7 -7
  55. package/test/integration/test_swap_with_refund_path.js +10 -9
  56. package/test/integration.js +18 -0
  57. package/test/p2p/test_encode_peer_request.js +13 -6
  58. package/test/p2p/test_encode_peer_response.js +6 -11
  59. package/test/p2p/test_encode_response_code.js +13 -6
  60. package/test/records/test_request_as_request_records.js +13 -6
  61. package/test/records/test_request_records_as_request.js +14 -6
  62. package/test/respond/test_error_as_error_records.js +13 -6
  63. package/test/respond/test_messages_for_response.js +13 -6
  64. package/test/respond/test_send_service_response.js +93 -81
  65. package/test/respond/test_urls_as_urls_record.js +13 -6
  66. package/test/server/test_get_service_request.js +14 -8
  67. package/test/server/test_invoice_as_request.js +13 -6
  68. package/test/server/test_paid_service_event.js +169 -161
  69. package/test/server/test_process_paywall.js +99 -93
  70. package/test/server/test_process_request.js +138 -126
  71. package/test/services/test_is_service_enabled.js +5 -6
  72. package/test/services/test_registered_services.js +5 -6
  73. package/test/services/test_respond_to_request.js +13 -6
  74. package/test/services/test_response_for_activity.js +14 -6
  75. package/test/services/test_response_for_inbox.js +14 -6
  76. package/test/services/test_response_for_network.js +13 -6
  77. package/test/services/test_response_for_pong.js +6 -11
  78. package/test/services/test_response_for_profile.js +13 -6
  79. package/test/services/test_response_for_schema.js +14 -6
  80. package/test/services/test_response_for_services.js +13 -6
  81. package/test/swaps/test_decode_loop_response.js +13 -6
  82. package/test/trades/test_decode_basic_trade.js +13 -6
  83. package/test/trades/test_decode_open_trade.js +13 -6
  84. package/test/trades/test_encode_open_trade.js +13 -6
  85. package/test/trades/test_encode_trade.js +13 -6
@@ -1,4 +1,5 @@
1
- const {test} = require('@alexbosworth/tap');
1
+ const {deepStrictEqual} = require('node:assert/strict');
2
+ const {test} = require('node:test');
2
3
 
3
4
  const method = require('./../../capacity/witness_script_from_close_txs');
4
5
 
@@ -38,16 +39,10 @@ const tests = [
38
39
  },
39
40
  ];
40
41
 
41
- tests.forEach(({args, description, error, expected}) => {
42
- return test(description, async ({end, strictSame, throws}) => {
43
- if (!!error) {
44
- throws(() => method(args), new Error(error), 'Got error');
45
- } else {
46
- const res = method(args);
42
+ tests.forEach(({args, description, expected}) => {
43
+ test(description, () => {
44
+ const res = method(args);
47
45
 
48
- strictSame(res, expected, 'Got expected result');
49
- }
50
-
51
- return end();
46
+ deepStrictEqual(res, expected, 'Got expected result');
52
47
  });
53
48
  });
@@ -1,4 +1,5 @@
1
- const {test} = require('@alexbosworth/tap');
1
+ const {deepStrictEqual, strictEqual, throws} = require('node:assert/strict');
2
+ const {test} = require('node:test');
2
3
 
3
4
  const method = require('./../../client/arguments_for_schema');
4
5
 
@@ -16,15 +17,21 @@ const tests = [
16
17
  ];
17
18
 
18
19
  tests.forEach(({args, description, error, expected}) => {
19
- return test(description, async ({end, strictSame, throws}) => {
20
+ test(description, () => {
20
21
  if (!!error) {
21
- throws(() => method(args), new Error(error), 'Got error');
22
+ throws(
23
+ () => method(args),
24
+ err => {
25
+ strictEqual(err.message, error, 'Got error');
26
+
27
+ return true;
28
+ },
29
+ 'Got error'
30
+ );
22
31
  } else {
23
32
  const res = method(args);
24
33
 
25
- strictSame(res, expected, 'Got expected result');
34
+ deepStrictEqual(res, expected, 'Got expected result');
26
35
  }
27
-
28
- return end();
29
36
  });
30
37
  });
@@ -1,4 +1,5 @@
1
- const {test} = require('@alexbosworth/tap');
1
+ const {strictEqual, throws} = require('node:assert/strict');
2
+ const {test} = require('node:test');
2
3
 
3
4
  const method = require('./../../client/byte_limited_string');
4
5
 
@@ -11,19 +12,25 @@ const tests = [
11
12
  ];
12
13
 
13
14
  tests.forEach(({args, description, error, expected}) => {
14
- return test(description, async ({end, strictSame, throws}) => {
15
+ test(description, () => {
15
16
  if (!!error) {
16
- throws(() => method(args), new Error(error), 'Got error');
17
+ throws(
18
+ () => method(args),
19
+ err => {
20
+ strictEqual(err.message, error, 'Got error');
21
+
22
+ return true;
23
+ },
24
+ 'Got error'
25
+ );
17
26
  } else {
18
27
  const none = Buffer.from(method(args).limited('')).toString('hex');
19
28
 
20
- strictSame(none, '', 'Null result is allowed');
29
+ strictEqual(none, '', 'Null result is allowed');
21
30
 
22
31
  const res = Buffer.from(method(args).limited('01🧔🏻‍♀️45')).toString('hex');
23
32
 
24
- strictSame(res, expected, 'Got expected result');
33
+ strictEqual(res, expected, 'Got expected result');
25
34
  }
26
-
27
- return end();
28
35
  });
29
36
  });
@@ -1,8 +1,10 @@
1
+ const {deepStrictEqual, rejects} = require('node:assert/strict');
2
+ const {test} = require('node:test');
3
+
1
4
  const {encodeTlvStream} = require('bolt01');
2
5
  const {makeInvoice} = require('mock-lnd');
3
6
  const {makeInvoiceSubscription} = require('mock-lnd');
4
7
  const {makeLnd} = require('mock-lnd');
5
- const {test} = require('@alexbosworth/tap');
6
8
 
7
9
  const method = require('./../../client/confirm_service_use');
8
10
 
@@ -48,15 +50,21 @@ const tests = [
48
50
  ];
49
51
 
50
52
  tests.forEach(({args, description, error, expected}) => {
51
- return test(description, async ({end, equal, rejects, strictSame}) => {
53
+ test(description, async () => {
52
54
  if (!!error) {
53
- await rejects(method(args), error, 'Got expected error');
55
+ await rejects(
56
+ method(args),
57
+ err => {
58
+ deepStrictEqual(err, error, 'Got expected error');
59
+
60
+ return true;
61
+ },
62
+ 'Got expected error'
63
+ );
54
64
  } else {
55
65
  const res = await method(args);
56
66
 
57
- strictSame(res, expected, 'Got expected result');
67
+ deepStrictEqual(res, expected, 'Got expected result');
58
68
  }
59
-
60
- return end();
61
69
  });
62
70
  });
@@ -1,4 +1,5 @@
1
- const {test} = require('@alexbosworth/tap');
1
+ const {deepStrictEqual, strictEqual, throws} = require('node:assert/strict');
2
+ const {test} = require('node:test');
2
3
 
3
4
  const method = require('./../../client/decode_nodes_record');
4
5
 
@@ -28,15 +29,21 @@ const tests = [
28
29
  ];
29
30
 
30
31
  tests.forEach(({args, description, error, expected}) => {
31
- return test(description, async ({end, strictSame, throws}) => {
32
+ test(description, () => {
32
33
  if (!!error) {
33
- throws(() => method(args), new Error(error), 'Got error');
34
+ throws(
35
+ () => method(args),
36
+ err => {
37
+ strictEqual(err.message, error, 'Got error');
38
+
39
+ return true;
40
+ },
41
+ 'Got error'
42
+ );
34
43
  } else {
35
44
  const res = method(args);
36
45
 
37
- strictSame(res, expected, 'Got expected result');
46
+ deepStrictEqual(res, expected, 'Got expected result');
38
47
  }
39
-
40
- return end();
41
48
  });
42
49
  });
@@ -1,6 +1,7 @@
1
- const {encodeBigSize} = require('bolt01');
1
+ const {deepStrictEqual, strictEqual, throws} = require('node:assert/strict');
2
+ const {test} = require('node:test');
3
+
2
4
  const {encodeTlvStream} = require('bolt01');
3
- const {test} = require('@alexbosworth/tap');
4
5
 
5
6
  const method = require('./../../client/decode_schema_fields');
6
7
 
@@ -82,15 +83,21 @@ const tests = [
82
83
  ];
83
84
 
84
85
  tests.forEach(({args, description, error, expected}) => {
85
- return test(description, async ({end, strictSame, throws}) => {
86
+ test(description, () => {
86
87
  if (!!error) {
87
- throws(() => method(args), new Error(error), 'Got error');
88
+ throws(
89
+ () => method(args),
90
+ err => {
91
+ strictEqual(err.message, error, 'Got error');
92
+
93
+ return true;
94
+ },
95
+ 'Got error'
96
+ );
88
97
  } else {
89
98
  const res = method(args);
90
99
 
91
- strictSame(res, expected, 'Got expected result');
100
+ deepStrictEqual(res, expected, 'Got expected result');
92
101
  }
93
-
94
- return end();
95
102
  });
96
103
  });
@@ -1,4 +1,5 @@
1
- const {test} = require('@alexbosworth/tap');
1
+ const {deepStrictEqual, strictEqual, throws} = require('node:assert/strict');
2
+ const {test} = require('node:test');
2
3
 
3
4
  const method = require('./../../client/decode_schema_records');
4
5
 
@@ -88,15 +89,21 @@ const tests = [
88
89
  ];
89
90
 
90
91
  tests.forEach(({args, description, error, expected}) => {
91
- return test(description, async ({end, strictSame, throws}) => {
92
+ test(description, () => {
92
93
  if (!!error) {
93
- throws(() => method(args), new Error(error), 'Got error');
94
+ throws(
95
+ () => method(args),
96
+ err => {
97
+ strictEqual(err.message, error, 'Got error');
98
+
99
+ return true;
100
+ },
101
+ 'Got error'
102
+ );
94
103
  } else {
95
104
  const res = method(args);
96
105
 
97
- strictSame(res, expected, 'Got expected result');
106
+ deepStrictEqual(res, expected, 'Got expected result');
98
107
  }
99
-
100
- return end();
101
108
  });
102
109
  });
@@ -1,5 +1,7 @@
1
+ const {deepStrictEqual, strictEqual, throws} = require('node:assert/strict');
2
+ const {test} = require('node:test');
3
+
1
4
  const {encodeTlvStream} = require('bolt01');
2
- const {test} = require('@alexbosworth/tap');
3
5
 
4
6
  const method = require('./../../client/decode_urls_record');
5
7
 
@@ -33,15 +35,21 @@ const tests = [
33
35
  ];
34
36
 
35
37
  tests.forEach(({args, description, error, expected}) => {
36
- return test(description, async ({end, strictSame, throws}) => {
38
+ test(description, () => {
37
39
  if (!!error) {
38
- throws(() => method(args), new Error(error), 'Got error');
40
+ throws(
41
+ () => method(args),
42
+ err => {
43
+ strictEqual(err.message, error, 'Got error');
44
+
45
+ return true;
46
+ },
47
+ 'Got error'
48
+ );
39
49
  } else {
40
50
  const res = method(args);
41
51
 
42
- strictSame(res, expected, 'Got expected result');
52
+ deepStrictEqual(res, expected, 'Got expected result');
43
53
  }
44
-
45
- return end();
46
54
  });
47
55
  });
@@ -1,5 +1,7 @@
1
+ const {deepStrictEqual, strictEqual, throws} = require('node:assert/strict');
2
+ const {test} = require('node:test');
3
+
1
4
  const {encodeTlvStream} = require('bolt01');
2
- const {test} = require('@alexbosworth/tap');
3
5
 
4
6
  const errorRecordsAsError = require('./../../client/error_records_as_error');
5
7
 
@@ -42,15 +44,21 @@ const tests = [
42
44
  ];
43
45
 
44
46
  tests.forEach(({args, description, error, expected}) => {
45
- return test(description, async ({end, strictSame, throws}) => {
47
+ test(description, () => {
46
48
  if (!!error) {
47
- throws(() => errorRecordsAsError(args), new Error(error), 'Got error');
49
+ throws(
50
+ () => errorRecordsAsError(args),
51
+ err => {
52
+ strictEqual(err.message, error, 'Got error');
53
+
54
+ return true;
55
+ },
56
+ 'Got error'
57
+ );
48
58
  } else {
49
59
  const res = errorRecordsAsError(args);
50
60
 
51
- strictSame(res, expected, 'Got expected result');
61
+ deepStrictEqual(res, expected, 'Got expected result');
52
62
  }
53
-
54
- return end();
55
63
  });
56
64
  });
@@ -1,10 +1,12 @@
1
+ const {deepStrictEqual, rejects} = require('node:assert/strict');
2
+ const {test} = require('node:test');
3
+
1
4
  const {encodeTlvStream} = require('bolt01');
2
5
  const {makeInvoice} = require('mock-lnd');
3
6
  const {makeInvoiceSubscription} = require('mock-lnd');
4
7
  const {makeLnd} = require('mock-lnd');
5
8
  const {makePaySubscription} = require('mock-lnd');
6
9
  const {makePayViaRoutesResponse} = require('mock-lnd');
7
- const {test} = require('@alexbosworth/tap');
8
10
 
9
11
  const messagesForResponse = require('./../../respond/messages_for_response');
10
12
  const method = require('./../../client/make_service_request');
@@ -66,15 +68,21 @@ const tests = [
66
68
  ];
67
69
 
68
70
  tests.forEach(({args, description, error, expected}) => {
69
- return test(description, async ({end, equal, rejects, strictSame}) => {
71
+ test(description, async () => {
70
72
  if (!!error) {
71
- await rejects(method(args), error, 'Got expected error');
73
+ await rejects(
74
+ method(args),
75
+ err => {
76
+ deepStrictEqual(err, error, 'Got expected error');
77
+
78
+ return true;
79
+ },
80
+ 'Got expected error'
81
+ );
72
82
  } else {
73
83
  const res = await method(args);
74
84
 
75
- strictSame(res, expected, 'Got expected result');
85
+ deepStrictEqual(res, expected, 'Got expected result');
76
86
  }
77
-
78
- return end();
79
87
  });
80
88
  });
@@ -1,5 +1,7 @@
1
+ const {deepStrictEqual, strictEqual, throws} = require('node:assert/strict');
2
+ const {test} = require('node:test');
3
+
1
4
  const {encodeTlvStream} = require('bolt01');
2
- const {test} = require('@alexbosworth/tap');
3
5
 
4
6
  const method = require('./../../client/messages_as_response');
5
7
 
@@ -133,15 +135,21 @@ const tests = [
133
135
  ];
134
136
 
135
137
  tests.forEach(({args, description, error, expected}) => {
136
- return test(description, async ({end, strictSame, throws}) => {
138
+ test(description, () => {
137
139
  if (!!error) {
138
- throws(() => method(args), new Error(error), 'Got error');
140
+ throws(
141
+ () => method(args),
142
+ err => {
143
+ strictEqual(err.message, error, 'Got error');
144
+
145
+ return true;
146
+ },
147
+ 'Got error'
148
+ );
139
149
  } else {
140
150
  const res = method(args);
141
151
 
142
- strictSame(res, expected, 'Got expected result');
152
+ deepStrictEqual(res, expected, 'Got expected result');
143
153
  }
144
-
145
- return end();
146
154
  });
147
155
  });
@@ -1,5 +1,7 @@
1
+ const {deepStrictEqual, strictEqual, throws} = require('node:assert/strict');
2
+ const {test} = require('node:test');
3
+
1
4
  const {encodeTlvStream} = require('bolt01');
2
- const {test} = require('@alexbosworth/tap');
3
5
 
4
6
  const method = require('./../../client/messages_for_request');
5
7
 
@@ -34,15 +36,21 @@ const tests = [
34
36
  ];
35
37
 
36
38
  tests.forEach(({args, description, error, expected}) => {
37
- return test(description, async ({end, strictSame, throws}) => {
39
+ test(description, () => {
38
40
  if (!!error) {
39
- throws(() => method(args), new Error(error), 'Got error');
41
+ throws(
42
+ () => method(args),
43
+ err => {
44
+ strictEqual(err.message, error, 'Got error');
45
+
46
+ return true;
47
+ },
48
+ 'Got error'
49
+ );
40
50
  } else {
41
51
  const res = method(args);
42
52
 
43
- strictSame(res, expected, 'Got expected result');
53
+ deepStrictEqual(res, expected, 'Got expected result');
44
54
  }
45
-
46
- return end();
47
55
  });
48
56
  });
@@ -1,8 +1,10 @@
1
+ const {deepStrictEqual, rejects} = require('node:assert/strict');
2
+ const {test} = require('node:test');
3
+
1
4
  const {encodeTlvStream} = require('bolt01');
2
5
  const {makeInvoice} = require('mock-lnd');
3
6
  const {makeInvoiceSubscription} = require('mock-lnd');
4
7
  const {makeLnd} = require('mock-lnd');
5
- const {test} = require('@alexbosworth/tap');
6
8
 
7
9
  const method = require('./../../client/wait_for_response');
8
10
 
@@ -42,15 +44,21 @@ const tests = [
42
44
  ];
43
45
 
44
46
  tests.forEach(({args, description, error, expected}) => {
45
- return test(description, async ({end, equal, rejects, strictSame}) => {
47
+ test(description, async () => {
46
48
  if (!!error) {
47
- await rejects(method(args), error, 'Got expected error');
49
+ await rejects(
50
+ method(args),
51
+ err => {
52
+ deepStrictEqual(err, error, 'Got expected error');
53
+
54
+ return true;
55
+ },
56
+ 'Got expected error'
57
+ );
48
58
  } else {
49
59
  const res = await method(args);
50
60
 
51
- strictSame(res, expected, 'Got expected result');
61
+ deepStrictEqual(res, expected, 'Got expected result');
52
62
  }
53
-
54
- return end();
55
63
  });
56
64
  });
@@ -1,4 +1,5 @@
1
- const {test} = require('@alexbosworth/tap');
1
+ const {strictEqual, throws} = require('node:assert/strict');
2
+ const {test} = require('node:test');
2
3
 
3
4
  const method = require('./../../config/is_activity_enabled');
4
5
 
@@ -29,15 +30,21 @@ const tests = [
29
30
  ];
30
31
 
31
32
  tests.forEach(({args, description, error, expected}) => {
32
- return test(description, async ({end, strictSame, throws}) => {
33
+ test(description, () => {
33
34
  if (!!error) {
34
- throws(() => method(args), new Error(error), 'Got error');
35
+ throws(
36
+ () => method(args),
37
+ err => {
38
+ strictEqual(err.message, error, 'Got error');
39
+
40
+ return true;
41
+ },
42
+ 'Got error'
43
+ );
35
44
  } else {
36
45
  const res = method(args);
37
46
 
38
- strictSame(res, expected, 'Got expected result');
47
+ strictEqual(res, expected, 'Got expected result');
39
48
  }
40
-
41
- return end();
42
49
  });
43
50
  });
@@ -1,4 +1,5 @@
1
- const {test} = require('@alexbosworth/tap');
1
+ const {strictEqual, throws} = require('node:assert/strict');
2
+ const {test} = require('node:test');
2
3
 
3
4
  const method = require('./../../config/is_connect_enabled');
4
5
 
@@ -24,15 +25,21 @@ const tests = [
24
25
  ];
25
26
 
26
27
  tests.forEach(({args, description, error, expected}) => {
27
- return test(description, async ({end, strictSame, throws}) => {
28
+ test(description, () => {
28
29
  if (!!error) {
29
- throws(() => method(args), new Error(error), 'Got error');
30
+ throws(
31
+ () => method(args),
32
+ err => {
33
+ strictEqual(err.message, error, 'Got error');
34
+
35
+ return true;
36
+ },
37
+ 'Got error'
38
+ );
30
39
  } else {
31
40
  const res = method(args);
32
41
 
33
- strictSame(res, expected, 'Got expected result');
42
+ strictEqual(res, expected, 'Got expected result');
34
43
  }
35
-
36
- return end();
37
44
  });
38
45
  });
@@ -1,4 +1,5 @@
1
- const {test} = require('@alexbosworth/tap');
1
+ const {strictEqual, throws} = require('node:assert/strict');
2
+ const {test} = require('node:test');
2
3
 
3
4
  const method = require('./../../config/is_email_configured');
4
5
 
@@ -38,15 +39,21 @@ const tests = [
38
39
  ];
39
40
 
40
41
  tests.forEach(({args, description, error, expected}) => {
41
- return test(description, async ({end, strictSame, throws}) => {
42
+ test(description, () => {
42
43
  if (!!error) {
43
- throws(() => method(args), new Error(error), 'Got error');
44
+ throws(
45
+ () => method(args),
46
+ err => {
47
+ strictEqual(err.message, error, 'Got error');
48
+
49
+ return true;
50
+ },
51
+ 'Got error'
52
+ );
44
53
  } else {
45
54
  const res = method(args);
46
55
 
47
- strictSame(res, expected, 'Got expected result');
56
+ strictEqual(res, expected, 'Got expected result');
48
57
  }
49
-
50
- return end();
51
58
  });
52
59
  });
@@ -1,4 +1,5 @@
1
- const {test} = require('@alexbosworth/tap');
1
+ const {strictEqual, throws} = require('node:assert/strict');
2
+ const {test} = require('node:test');
2
3
 
3
4
  const method = require('./../../config/is_invoice_enabled');
4
5
 
@@ -24,15 +25,21 @@ const tests = [
24
25
  ];
25
26
 
26
27
  tests.forEach(({args, description, error, expected}) => {
27
- return test(description, async ({end, strictSame, throws}) => {
28
+ test(description, () => {
28
29
  if (!!error) {
29
- throws(() => method(args), new Error(error), 'Got error');
30
+ throws(
31
+ () => method(args),
32
+ err => {
33
+ strictEqual(err.message, error, 'Got error');
34
+
35
+ return true;
36
+ },
37
+ 'Got error'
38
+ );
30
39
  } else {
31
40
  const res = method(args);
32
41
 
33
- strictSame(res, expected, 'Got expected result');
42
+ strictEqual(res, expected, 'Got expected result');
34
43
  }
35
-
36
- return end();
37
44
  });
38
45
  });
@@ -1,4 +1,5 @@
1
- const {test} = require('@alexbosworth/tap');
1
+ const {strictEqual, throws} = require('node:assert/strict');
2
+ const {test} = require('node:test');
2
3
 
3
4
  const method = require('./../../config/is_sms_configured');
4
5
 
@@ -44,15 +45,21 @@ const tests = [
44
45
  ];
45
46
 
46
47
  tests.forEach(({args, description, error, expected}) => {
47
- return test(description, async ({end, strictSame, throws}) => {
48
+ test(description, () => {
48
49
  if (!!error) {
49
- throws(() => method(args), new Error(error), 'Got error');
50
+ throws(
51
+ () => method(args),
52
+ err => {
53
+ strictEqual(err.message, error, 'Got error');
54
+
55
+ return true;
56
+ },
57
+ 'Got error'
58
+ );
50
59
  } else {
51
60
  const res = method(args);
52
61
 
53
- strictSame(res, expected, 'Got expected result');
62
+ strictEqual(res, expected, 'Got expected result');
54
63
  }
55
-
56
- return end();
57
64
  });
58
65
  });
@@ -1,4 +1,5 @@
1
- const {test} = require('@alexbosworth/tap');
1
+ const {deepStrictEqual, strictEqual, throws} = require('node:assert/strict');
2
+ const {test} = require('node:test');
2
3
 
3
4
  const method = require('./../../config/validate_server_config');
4
5
 
@@ -42,15 +43,21 @@ const tests = [
42
43
  ];
43
44
 
44
45
  tests.forEach(({args, description, error, expected}) => {
45
- return test(description, async ({end, strictSame, throws}) => {
46
+ test(description, () => {
46
47
  if (!!error) {
47
- throws(() => method(args), new Error(error), 'Got error');
48
+ throws(
49
+ () => method(args),
50
+ err => {
51
+ strictEqual(err.message, error, 'Got error');
52
+
53
+ return true;
54
+ },
55
+ 'Got error'
56
+ );
48
57
  } else {
49
58
  const res = method(args);
50
59
 
51
- strictSame(res, expected, 'Got expected result');
60
+ deepStrictEqual(res, expected, 'Got expected result');
52
61
  }
53
-
54
- return end();
55
62
  });
56
63
  });