Skip to content

Commit 9269d76

Browse files
authored
Merge pull request #16 from oslabs-beta/supertest-user
Supertest user
2 parents eb73198 + 48375f3 commit 9269d76

File tree

12 files changed

+225
-264
lines changed

12 files changed

+225
-264
lines changed

__tests__/gql.projects.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
/**
2-
* @jest-environment node
3-
*/
1+
// /**
2+
// * @jest-environment node
3+
// */
44

5-
const { Mongoose } = require('mongoose');
6-
const request = require('supertest');
7-
const http = require('http');
8-
const app = require('../server/server');
9-
const mock = require('../mockData');
5+
// const { Mongoose } = require('mongoose');
6+
// const request = require('supertest');
7+
// const http = require('http');
8+
// const app = require('../server/server');
9+
// const mock = require('../mockData');
1010

1111
// tests user signup and login routes
1212
xdescribe('GraphQL tests', () => {

__tests__/projects.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const http = require('http')
1111
const {state, projectToSave } = mockData
1212

1313
// save and get projects endpoint testing
14-
describe('Project endpoints tests', () => {
14+
xdescribe('Project endpoints tests', () => {
1515
let server;
1616
beforeAll((done) => {
1717
server = http.createServer(app);
@@ -22,7 +22,7 @@ describe('Project endpoints tests', () => {
2222
server.close(done);
2323
});
2424
// test saveProject endpoint
25-
describe('/saveProject', () => {
25+
xdescribe('/saveProject', () => {
2626
describe('/POST', () => {
2727
it('responds with a status of 200 and json object equal to project sent', () => {
2828
return request(server)
@@ -36,7 +36,7 @@ describe('Project endpoints tests', () => {
3636
});
3737
});
3838
// test getProjects endpoint
39-
describe('/getProjects', () => {
39+
xdescribe('/getProjects', () => {
4040
describe('POST', () => {
4141
it('responds with status of 200 and json object equal to an array of user projects', () => {
4242
return request(server)
@@ -53,7 +53,7 @@ describe('Project endpoints tests', () => {
5353
});
5454
});
5555
// test deleteProject endpoint
56-
describe('/deleteProject', () => {
56+
xdescribe('/deleteProject', () => {
5757
describe('DELETE', () => {
5858
const { name, userId } = projectToSave;
5959
it('responds with status of 200 and json object equal to deleted project', () => {

__tests__/spec.ts

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
import 'regenerator-runtime/runtime'; // if there is an error with moduleNameMapper, npm -S install regenerator-runtime
22

33
//const { Application } = require('spectron');
4-
const electronPath = require('electron');
5-
const path = require('path');
4+
// const electronPath = require('electron');
5+
// const path = require('path');
66

7-
let app;
7+
// let app;
88

9-
// beforeAll(() => {
10-
// // create a new app to test with setTimeout to be 15000 because the app takes a few seconds to spin up
11-
// app = new Application({
12-
// path: electronPath,
13-
// chromeDriverArgs: ['--disable-extensions'],
14-
// args: [path.join(__dirname, '../app/electron/main.js')] // this is the path from this test file to main.js inside electron folder
15-
// });
16-
// return app.start();
17-
// }, 15000);
9+
// // beforeAll(() => {
10+
// // // create a new app to test with setTimeout to be 15000 because the app takes a few seconds to spin up
11+
// // app = new Application({
12+
// // path: electronPath,
13+
// // chromeDriverArgs: ['--disable-extensions'],
14+
// // args: [path.join(__dirname, '../app/electron/main.js')] // this is the path from this test file to main.js inside electron folder
15+
// // });
16+
// // return app.start();
17+
// // }, 15000);
1818

19-
// getWindowsCount() will return 2 instead of 1 in dev mode (one for the actual app, one in the browser at localhost:8080 in dev mode)
20-
xtest('Displays App window', async () => {
21-
const windowCount = await app.client.getWindowCount();
22-
// expect(windowCount).toBe(1); // this returns true/passed if in production mode, change mode in script "test" to 'production' instead of 'test'
23-
expect(windowCount).toBe(2); // 'dev' or 'test' mode results in 2 windows (one for the app and one for the browser)
24-
});
25-
26-
/* we want to test other functionalities of app.client such as text, title, etc. but even the examples from the official spectron website
27-
or github repo did not yield the same outcomes as demonstrated. So we stopped testing Electron app here */
28-
// afterAll(() => {
29-
// if (app && app.isRunning()) {
30-
// return app.stop();
31-
// }
19+
// // getWindowsCount() will return 2 instead of 1 in dev mode (one for the actual app, one in the browser at localhost:8080 in dev mode)
20+
// xtest('Displays App window', async () => {
21+
// const windowCount = await app.client.getWindowCount();
22+
// // expect(windowCount).toBe(1); // this returns true/passed if in production mode, change mode in script "test" to 'production' instead of 'test'
23+
// expect(windowCount).toBe(2); // 'dev' or 'test' mode results in 2 windows (one for the app and one for the browser)
3224
// });
25+
26+
// /* we want to test other functionalities of app.client such as text, title, etc. but even the examples from the official spectron website
27+
// or github repo did not yield the same outcomes as demonstrated. So we stopped testing Electron app here */
28+
// // afterAll(() => {
29+
// // if (app && app.isRunning()) {
30+
// // return app.stop();
31+
// // }
32+
// // });

__tests__/userAuth.test.ts

Lines changed: 0 additions & 90 deletions
This file was deleted.

__tests__/users.test.ts

Lines changed: 0 additions & 122 deletions
This file was deleted.

0 commit comments

Comments
 (0)