Skip to content

Commit

Permalink
refactor: rename core classes to match new project name
Browse files Browse the repository at this point in the history
  • Loading branch information
matmar10 committed Apr 3, 2022
1 parent 0b936a6 commit 815d0a2
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ process
const program = require('commander');
import fs from 'fs';
import path from 'path';
import JustAPI from './just-api';
import RestEZ from './rest-ez';
import { findSuiteFiles, doesDirectoryExist } from './utils';

program
Expand Down Expand Up @@ -80,5 +80,5 @@ let additionalOptions = {
reporterOptions: program.reporterOptions
};

const justAPI = new JustAPI(suiteFiles, additionalOptions);
justAPI.init();
const restEZ = new RestEZ(suiteFiles, additionalOptions);
restEZ.init();
10 changes: 5 additions & 5 deletions lib/request.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';

const request = require('request');
import JustAPIResponse from './response';
import RestEZResponse from './response';

export default class JustAPIRequest {
export default class RestEZRequest {
constructor(options, test) {
this.options = options;
this.test = test;
Expand All @@ -13,7 +13,7 @@ export default class JustAPIRequest {
if (this.options.cookiesData && Object.keys(this.options.cookiesData).length > 0) {

let cookieJar = request.jar();

for (let [ key, value ] of Object.entries(this.options.cookiesData)) {
cookieJar.setCookie(request.cookie(`${key}=${value}`), this.options.baseUrl || this.options.url);
}
Expand Down Expand Up @@ -60,8 +60,8 @@ export default class JustAPIRequest {

self.test.suite.requests.push(log);

let justAPIResponse = new JustAPIResponse(this, err, response, body);
return resolve(justAPIResponse);
let restEZResponse = new RestEZResponse(this, err, response, body);
return resolve(restEZResponse);
});
});

Expand Down
2 changes: 1 addition & 1 deletion lib/response.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

export default class JustAPIResponse {
export default class RestEZResponse {

constructor(req, err, response, body) {
this._req = req;
Expand Down
2 changes: 1 addition & 1 deletion lib/just-api.js → lib/rest-ez.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { isNumber } from './utils';

const MAX_PARALLEL_LIMIT = 24;

export default class JustAPI {
export default class RestEZ {

constructor(suiteFiles, options) {
this.suites = suiteFiles;
Expand Down
4 changes: 2 additions & 2 deletions lib/spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

import JustAPIRequest from './request';
import RestEZRequest from './request';
import fs from 'fs';
import path from 'path';
import { assertFileValidity, loadModule, runModuleFunction, runInlineFunction, wait, isNumber, equals as isEqual } from './utils';
Expand Down Expand Up @@ -222,7 +222,7 @@ export default class Spec {
}

async processRequest(opts) {
let _req = new JustAPIRequest(opts, this);
let _req = new RestEZRequest(opts, this);
return _req.send();
}

Expand Down

0 comments on commit 815d0a2

Please sign in to comment.