wchagas / pagseguro-node

Integração com pagseguro em nodejs
MIT License
66 stars 23 forks source link

Ambiente Windows - Erro ao executar os testes - Cannot find module './config' from 'transaction.test.js' #10

Closed flavioro closed 4 years ago

flavioro commented 4 years ago

Quando realizado as instalações dos pacotes apresenta erros ao executar os testes em ambiente Windows:

SET NODE_ENV=tests&&jest

FAIL tests/transaction.test.js ● Test suite failed to run

Cannot find module './config' from 'transaction.test.js'

1 | const config = require("./config"); | ^ 2 | const pagseguro = require("../src"); 3 | const moment = require("moment"); 4 |

at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:259:17) at Object. (tests/transaction.test.js:1:1) FAIL tests/installment.test.js ● Test suite failed to run

Cannot find module './config' from 'installment.test.js'

1 | const config = require('./config') | ^ 2 | const pagseguro = require('../src') 3 | 4 | describe('Installment', function() {

at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:259:17) at Object. (tests/installment.test.js:1:1) FAIL tests/session.test.js ● Test suite failed to run

Cannot find module './config' from 'session.test.js'

1 | const config = require("./config"); | ^ 2 | const pagseguro = require("../src"); 3 | 4 | describe("Session", function() {

at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:259:17) at Object. (tests/session.test.js:1:1) FAIL tests/format.test.js ● Test suite failed to run

Cannot find module './config' from 'format.test.js'

1 | const config = require('./config') | ^ 2 | const pagseguro = require('../src') 3 | const clone = require('clone') 4 |

at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:259:17) at Object. (tests/format.test.js:1:1) FAIL tests/connect.test.js ● Test suite failed to run

Cannot find module './config' from 'connect.test.js'

1 | const config = require('./config') | ^ 2 | const pagseguro = require('../src') 3 | 4 | describe('Connect', function() {

at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:259:17) at Object. (tests/connect.test.js:1:1) FAIL tests/authorization.test.js ● Test suite failed to run

Cannot find module './config' from 'authorization.test.js'

1 | const config = require('./config') | ^ 2 | const pagseguro = require('../src') 3 | 4 | describe('Authorization', function() {

at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:259:17) at Object. (tests/authorization.test.js:1:1) Test Suites: 6 failed, 6 total Tests: 0 total Snapshots: 0 total Time: 7.299s

flavioro commented 4 years ago

Ops, já localizei meu erro, preciso renomear o arquivo tests/config_example.js para tests/config.js