Skip to content

Commit

Permalink
fix(CI)node version.
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanProjetos committed Sep 7, 2023
1 parent 32e0894 commit 292a0b9
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand Down
1 change: 0 additions & 1 deletion src/services/PayableServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const sumPayable = require('../helpers/sumPayable');
const PayableServices = {
getBalance: async (query, email) => {
if (!query) throw new Error('400|Status is required');

// Faz a validação do status da query
const status = joiPayable({ status: query });

Expand Down
Empty file.
Empty file.
34 changes: 34 additions & 0 deletions src/tests/integration/User.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const chai = require('chai');
const { describe, it } = require('mocha');
const sinon = require('sinon');
const chaiHttp = require('chai-http');
const app = require('../../app');
const { Sequelize } = require('../../database/models');
const { User } = require('../mocks/mockDataTransaction');
const { expect } = chai;

chai.use(chaiHttp);

describe('Testando o end-point /sing-in', () => {
afterEach(() => {
sinon.restore();
});

it('Testando o retorno em caso de requisição bem sucedida', async () => {
const payload = {
email: '[email protected]',
password: '123456'
};

sinon.stub(Sequelize.Model, 'findOne').resolves(() => User);

await chai
.request(app)
.post('/sing-in')
.send(payload);

expect(User.name).to.exist;
expect(User).to.be.a('object');
expect(User).to.have.property('name');
});
});
8 changes: 8 additions & 0 deletions src/tests/mocks/mockDataTransaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,17 @@ const inputTransaction = {
cardCvv: 874,
}

const User = {
id: 1,
name: "m3gan eu sou robô",
lastName: null,
email: '[email protected]'
}

module.exports = {
dataReponse,
dataReponsePayable,
inputTransaction,
outputPayable,
User
};

0 comments on commit 292a0b9

Please sign in to comment.