@insignia-education/api-sdk-js 0.9.17 → 0.9.18
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.
- package/package.json +1 -1
- package/src/Client.js +6 -4
- package/tests/integration/api.v1..test.js +16 -0
package/package.json
CHANGED
package/src/Client.js
CHANGED
|
@@ -6,10 +6,12 @@ export default class InsigniaClient {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
static _resolve(baseUrl) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const envBaseUrl = typeof process !== 'undefined'
|
|
10
|
+
? process.env?.INSIGNIA_EDUCATION_API_BASE_URL ?? null
|
|
11
|
+
: null;
|
|
12
|
+
|
|
13
|
+
baseUrl = baseUrl ?? envBaseUrl ?? 'https://insigniaeducation.com';
|
|
14
|
+
baseUrl = baseUrl.replace(/\/$/, '');
|
|
13
15
|
return baseUrl;
|
|
14
16
|
}
|
|
15
17
|
|
|
@@ -74,3 +74,19 @@ describe('Languages', () => {
|
|
|
74
74
|
});
|
|
75
75
|
});
|
|
76
76
|
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
describe('Auth', () => {
|
|
80
|
+
test('get() returns a list', async () => {
|
|
81
|
+
const res = await api.auth.login({
|
|
82
|
+
email: process.env.TEST_EMAIL,
|
|
83
|
+
password: process.env.TEST_PASSWORD
|
|
84
|
+
})
|
|
85
|
+
.then(response => {
|
|
86
|
+
|
|
87
|
+
expect(response["success"]).toBeDefined();
|
|
88
|
+
expect(response["success"]).toBe("ok");
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
|