We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7c0b0db commit c467c44Copy full SHA for c467c44
0x06-unittests_in_js/6-payment_token.js
@@ -0,0 +1,12 @@
1
+// function that returns token from api
2
+/* eslint-disable consistent-return */
3
+function getPaymentTokenFromAPI(success) {
4
+ if (success) {
5
+ return new Promise((resolve) => {
6
+ resolve({ data: 'Successful response from the API' });
7
+ });
8
+ }
9
+ // Implicitly returns undefined for false
10
+}
11
+
12
+module.exports = getPaymentTokenFromAPI;
0 commit comments