Browse Source

test: Update smoke test script

Michael Bromley 5 years ago
parent
commit
5c4621c044
1 changed files with 6 additions and 6 deletions
  1. 6 6
      .github/workflows/scripts/smoke-tests.js

+ 6 - 6
.github/workflows/scripts/smoke-tests.js

@@ -10,7 +10,7 @@ const adminUrl = 'http://localhost:3000/admin-api';
  */
 awaitServerStartup()
     .then(() => runTests())
-    .catch((e) => {
+    .catch(e => {
         console.log('Tests failed!');
         console.log(e);
         process.exit(1);
@@ -60,7 +60,7 @@ async function runTests() {
     const result2 = await gqlRequest(
         adminUrl,
         `
-        { "query": "mutation { login(username: \\"superadmin\\" password: \\"superadmin\\")  { user { id } } }" }
+        { "query": "mutation { login(username: \\"superadmin\\" password: \\"superadmin\\")  { ...on CurrentUser { id } } }" }
     `,
     );
     assertEquals(result2.data.login, { user: { id: '1' } });
@@ -70,7 +70,7 @@ async function runTests() {
 }
 
 function gqlRequest(url, body) {
-    return request(url, 'POST', body).catch((e) => console.log(e));
+    return request(url, 'POST', body).catch(e => console.log(e));
 }
 
 /**
@@ -88,10 +88,10 @@ function request(url, method, body) {
     };
 
     return new Promise((resolve, reject) => {
-        const req = http.request(url, options, (res) => {
+        const req = http.request(url, options, res => {
             var response = '';
             res.setEncoding('utf8');
-            res.on('data', (chunk) => {
+            res.on('data', chunk => {
                 return (response += chunk);
             });
             res.on('end', () => {
@@ -99,7 +99,7 @@ function request(url, method, body) {
             });
         });
 
-        req.on('error', (e) => {
+        req.on('error', e => {
             reject(e);
         });