Skip to content

Commit

Permalink
Merge pull request #308 from oslabs-beta/master
Browse files Browse the repository at this point in the history
LA46 - Chris Pan, Jennifer Wu, Adrian Uesugui, Jacob Viesselman, Michael Prince
  • Loading branch information
MichaelGPrince committed Nov 24, 2021
2 parents abe8e9c + c1d03fc commit 6e429f9
Show file tree
Hide file tree
Showing 90 changed files with 1,891 additions and 1,044 deletions.
7 changes: 5 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ module.exports = {
version: 'detect',
},
'import/resolver': {
typescript: {},
typescript: {
// "alwaysTryTypes": true, //->new
},
'babel-module': {
root: ['.'],
alias: {
Expand Down Expand Up @@ -75,7 +77,7 @@ module.exports = {
'guard-for-in': 0,
'import/extensions': 0,
'import/no-extraneous-dependencies': 0,
'import/no-unresolved': 0,
'import/no-unresolved': 0, // <-- was 0
'import/prefer-default-export': 0,
'max-len': 0,
'no-alert': 0,
Expand Down Expand Up @@ -138,6 +140,7 @@ module.exports = {
},
'import/resolver': {
typescript: {
// alwaysTryTypes: true, //<--- just added this
project: './tsconfig.json',
},
},
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ Swell is a one-stop shop for sending and monitoring your API requests
]
```

- _Webhooks_: Swell includes user-defined HTTP callback connection testing designed to test other server's connection to the web and ability to send data. The test insures that when an event occurs, the source site makes an HTTP request to the URL configured for the webhook.
<kbd><img src="./ReadMeGifs/Gifs/Webhook.gif" style="float: left; margin-right: 10px;margin-bottom : 30px; margin-top : 10px;" /></kbd>
## Additional Features
- _Scripting in Swell_: Swell allows you to write assertion tests to aid in the test-driven development cycle of backend API services.
Expand All @@ -87,6 +90,9 @@ Swell is a one-stop shop for sending and monitoring your API requests
- _Schedule Tests_: You can also automate sending requests to occur on a periodic basis.
<kbd><img src="./ReadMeGifs/Gifs/ScheduleTest.gif"
style="float: left; margin-right: 10px; margin-bottom : 30px; margin-top : 10px; border: 1px solid black;" /></kbd>
- _Dark Mode_: Swell allows you to toggle between light and dark mode when viewing the application.
<kbd><img src="./ReadMeGifs/Gifs/DarkMode.gif"
style="float: left; margin-right: 10px; margin-bottom : 30px; margin-top : 10px; border: 1px solid black;" /></kbd>
## Built With
Expand Down Expand Up @@ -148,6 +154,11 @@ Swell is a one-stop shop for sending and monitoring your API requests
- **Ted Craig** - [tedcraig](https://github.com/tedcraig)
- **Anthony Wong** - [awong428](https://github.com/awong428)
- **John Jongsun Suh** - [MajorLift](https://github.com/MajorLift)
- **Christopher Pan** - [ChristopherJPan](https://github.com/ChristopherJPan)
- **Adrian Uesugui** - [auesugui](https://github.com/auesugui)
- **Jennifer Wu** - [jsh-wu](https://github.com/jsh-wu)
- **Jacob Viesselman** - [JacobViesselman](https://github.com/JacobViesselman)
- **Michael Prince** - [MichaelGPrince](https://github.com/MichaelGPrince)
## License
Expand Down
Binary file added ReadMeGifs/Gifs/DarkMode.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ReadMeGifs/Gifs/Webhook.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 18 additions & 18 deletions __tests__/businessReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ describe('Business reducer', () => {
history: [
{
id: 'd79d8f1a-f53c-41a1-a7e3-514f9f5cf24e',
created_at: '2019-02-15T21:40:44.132Z',
createdAt: '2019-02-15T21:40:44.132Z',
},
{
id: 'c8d73eec-e383-4735-943a-20deab42ecff',
created_at: '2019-02-15T20:52:35.990Z',
createdAt: '2019-02-15T20:52:35.990Z',
},
],
},
Expand All @@ -131,11 +131,11 @@ describe('Business reducer', () => {
history: [
{
id: '0faf2207-20d3-4f62-98ca-51a39c8c15dd',
created_at: '2019-02-15T00:40:56.360Z',
createdAt: '2019-02-15T00:40:56.360Z',
},
{
id: '577eab93-e707-4dc0-af45-7adcc78807fa',
created_at: '2019-02-15T00:16:56.133Z',
createdAt: '2019-02-15T00:16:56.133Z',
},
],
},
Expand All @@ -160,7 +160,7 @@ describe('Business reducer', () => {
history: [
{
id: 'c8d73eec-e383-4735-943a-20deab42ecff',
created_at: '2019-02-15T20:52:35.990Z',
createdAt: '2019-02-15T20:52:35.990Z',
},
],
},
Expand All @@ -169,11 +169,11 @@ describe('Business reducer', () => {
history: [
{
id: '0faf2207-20d3-4f62-98ca-51a39c8c15dd',
created_at: '2019-02-15T00:40:56.360Z',
createdAt: '2019-02-15T00:40:56.360Z',
},
{
id: '577eab93-e707-4dc0-af45-7adcc78807fa',
created_at: '2019-02-15T00:16:56.133Z',
createdAt: '2019-02-15T00:16:56.133Z',
},
],
},
Expand All @@ -188,7 +188,7 @@ describe('Business reducer', () => {
type: 'DELETE_HISTORY',
payload: {
id: '0faf2207-20d3-4f62-98ca-51a39c8c15dd',
created_at: '2019-02-15T00:40:56.360Z',
createdAt: '2019-02-15T00:40:56.360Z',
},
};

Expand All @@ -205,7 +205,7 @@ describe('Business reducer', () => {
type: 'DELETE_HISTORY',
payload: {
id: 'c8d73eec-e383-4735-943a-20deab42ecff',
created_at: '2019-02-15T20:52:35.990Z',
createdAt: '2019-02-15T20:52:35.990Z',
},
};
const initialHistory = state.history;
Expand Down Expand Up @@ -234,15 +234,15 @@ describe('Business reducer', () => {
describe('REQRES_ADD', () => {
const fakeReqRes1 = {
id: 'd79d8f1a-f53c-41a1-a7e3-514f9f5cf24e',
created_at: '2019-02-15T21:40:44.132Z',
createdAt: '2019-02-15T21:40:44.132Z',
protocol: 'http://',
request: { method: 'POST', body: 'I am a request body' },
response: {},
};

const fakeReqRes2 = {
id: 'c8d73eec-e383-4735-943a-20deab42ecff',
created_at: '2019-02-16T20:52:35.990Z',
createdAt: '2019-02-16T20:52:35.990Z',
protocol: 'http://',
request: { method: 'POST', body: 'I am a newer request body' },
response: {},
Expand Down Expand Up @@ -281,15 +281,15 @@ describe('Business reducer', () => {
const fakeReqResArray = [
{
id: 'c8d73eec-e383-4735-943a-20deab42ecff',
created_at: '2019-02-15T20:52:35.990Z',
createdAt: '2019-02-15T20:52:35.990Z',
},
{
id: '0faf2207-20d3-4f62-98ca-51a39c8c15dd',
created_at: '2019-02-15T00:40:56.360Z',
createdAt: '2019-02-15T00:40:56.360Z',
},
{
id: '577eab93-e707-4dc0-af45-7adcc78807fa',
created_at: '2019-02-15T00:16:56.133Z',
createdAt: '2019-02-15T00:16:56.133Z',
},
];

Expand All @@ -313,23 +313,23 @@ describe('Business reducer', () => {
const fakeReqResArray = [
{
id: 'c8d73eec-e383-4735-943a-20deab42ecff',
created_at: '2019-02-15T20:52:35.990Z',
createdAt: '2019-02-15T20:52:35.990Z',
},
{
id: '0faf2207-20d3-4f62-98ca-51a39c8c15dd',
created_at: '2019-02-15T00:40:56.360Z',
createdAt: '2019-02-15T00:40:56.360Z',
},
{
id: '577eab93-e707-4dc0-af45-7adcc78807fa',
created_at: '2019-02-15T00:16:56.133Z',
createdAt: '2019-02-15T00:16:56.133Z',
},
];

const action = {
type: 'REQRES_UPDATE',
payload: {
id: '0faf2207-20d3-4f62-98ca-51a39c8c15dd',
created_at: '2018-02-15T00:40:56.360Z',
createdAt: '2018-02-15T00:40:56.360Z',
newKey: 'this is a new value',
},
};
Expand Down
8 changes: 4 additions & 4 deletions __tests__/dbTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ Dexie.dependencies.IDBKeyRange = require('fake-indexeddb/lib/FDBKeyRange');
const db = new Dexie('test');

db.version(2).stores({
history: 'id, created_at',
collections: 'id, created_at, &name',
history: 'id, createdAt',
collections: 'id, createdAt, &name',
});

db.version(1).stores({
history: 'id, created_at',
history: 'id, createdAt',
});

// now we have db.history and db.collections
Expand All @@ -45,7 +45,7 @@ describe('db test', () => {

it('will not add history without an id', async () => {
await db.history
.put({ created_at: Date.now() })
.put({ createdAt: Date.now() })
.catch((err) => expect(err.name).toEqual('DataError'));
const count = await db.history.count();
expect(count).toEqual(0);
Expand Down
2 changes: 1 addition & 1 deletion __tests__/httpTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ xdescribe('REST API Requests', () => {
// define request
const request = {
id: 'testID',
// created_at: 2020-11-04T19:33:55.829Z,
// createdAt: 2020-11-04T19:33:55.829Z,
protocol: 'http://',
host: 'http://jsonplaceholder.typicode.com',
path: '/posts',
Expand Down
6 changes: 3 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Allow self-signing HTTPS over TLS
process.env.NODE_TLS_REJECT_UNAUTHORIZED = 1;
// process.env.NODE_TLS_REJECT_UNAUTHORIZED = 1;
// Allow self-signing HTTPS over TLS
// Disabling Node's rejection of invalid/unauthorized certificates
// process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
// from stack overflow: https://stackoverflow.com/a/35633993/11606641
// Your fix is insecure and shouldn't really be done at all, but is often done in development (it should never be done in production).
// The proper solution should be to put the self-signed certificate in your trusted root store OR to get a proper certificate signed by an existing Certificate Authority (which is already trusted by your server).
Expand Down Expand Up @@ -329,7 +329,7 @@ ipcMain.on('import-collection', (event, args) => {
!parsed.id ||
!parsed.name ||
!parsed.reqResArray ||
!parsed.created_at
!parsed.createdAt
) {
options.message = 'Invalid File';
options.detail = 'Please try again.';
Expand Down
Loading

0 comments on commit 6e429f9

Please sign in to comment.