Skip to content

Commit

Permalink
upgrade jest and fix uncontroversial tests
Browse files Browse the repository at this point in the history
  • Loading branch information
janpaepke committed Dec 13, 2023
1 parent cc69b96 commit 5f8517e
Show file tree
Hide file tree
Showing 8 changed files with 1,043 additions and 2,456 deletions.
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -49,15 +49,15 @@
"@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.21.0",
"@mollie/eslint-config-typescript": "^1.6.5",
"@types/jest": "24.9.0",
"@types/jest": "^29.5.11",
"@types/node": "^18.14.6",
"axios-mock-adapter": "1.19.0",
"babel-jest": "^29.5.0",
"commitizen": "^4.3.0",
"cz-conventional-changelog": "^3.3.0",
"dotenv": "^16.0.3",
"eslint": "^8.35.0",
"jest": "24.9.0",
"jest": "^29.7.0",
"jest-bluster": "^1.0.1",
"nock": "^13.3.0",
"nock-record": "^0.3.9",
Expand Down
3 changes: 1 addition & 2 deletions tests/integration/chargebacks.test.ts
@@ -1,12 +1,11 @@
import axios from 'axios';
import httpAdapter from 'axios/lib/adapters/http';
import dotenv from 'dotenv';
import createMollieClient from '../..';

/**
* Overwrite the default XMLHttpRequestAdapter
*/
axios.defaults.adapter = httpAdapter;
axios.defaults.adapter = 'http';

/**
* Load the API_KEY environment variable
Expand Down
3 changes: 1 addition & 2 deletions tests/integration/customers.test.ts
@@ -1,12 +1,11 @@
import axios from 'axios';
import httpAdapter from 'axios/lib/adapters/http';
import dotenv from 'dotenv';
import createMollieClient from '../..';

/**
* Overwrite the default XMLHttpRequestAdapter
*/
axios.defaults.adapter = httpAdapter;
axios.defaults.adapter = 'http';

/**
* Load the API_KEY environment variable
Expand Down
3 changes: 1 addition & 2 deletions tests/integration/methods.test.ts
@@ -1,12 +1,11 @@
import axios from 'axios';
import httpAdapter from 'axios/lib/adapters/http';
import dotenv from 'dotenv';
import createMollieClient from '../..';

/**
* Overwrite the default XMLHttpRequestAdapter
*/
axios.defaults.adapter = httpAdapter;
axios.defaults.adapter = 'http';

/**
* Load the API_KEY environment variable
Expand Down
3 changes: 1 addition & 2 deletions tests/integration/refunds.test.ts
@@ -1,12 +1,11 @@
import axios from 'axios';
import httpAdapter from 'axios/lib/adapters/http';
import dotenv from 'dotenv';
import createMollieClient from '../..';

/**
* Overwrite the default XMLHttpRequestAdapter
*/
axios.defaults.adapter = httpAdapter;
axios.defaults.adapter = 'http';

/**
* Load the API_KEY environment variable
Expand Down
52 changes: 26 additions & 26 deletions tests/unit/resources/__snapshots__/lists.test.ts.snap
@@ -1,14 +1,14 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`lists .list() should retrieve the next page 1`] = `
Array [
Object {
"_links": Object {
"documentation": Object {
[
{
"_links": {
"documentation": {
"href": "https://docs.mollie.com/reference/v2/customers-api/get-customer",
"type": "text/html",
},
"self": Object {
"self": {
"href": "https://api.mollie.com/v2/customers/cst_l4J9zsdzO",
"type": "application/hal+json",
},
Expand All @@ -22,13 +22,13 @@ Array [
"name": "Customer 4",
"resource": "customer",
},
Object {
"_links": Object {
"documentation": Object {
{
"_links": {
"documentation": {
"href": "https://docs.mollie.com/reference/v2/customers-api/get-customer",
"type": "text/html",
},
"self": Object {
"self": {
"href": "https://api.mollie.com/v2/customers/cst_CFAhWkIKz",
"type": "application/hal+json",
},
Expand All @@ -42,13 +42,13 @@ Array [
"name": "Customer 5",
"resource": "customer",
},
Object {
"_links": Object {
"documentation": Object {
{
"_links": {
"documentation": {
"href": "https://docs.mollie.com/reference/v2/customers-api/get-customer",
"type": "text/html",
},
"self": Object {
"self": {
"href": "https://api.mollie.com/v2/customers/cst_5BsP6Y1S8",
"type": "application/hal+json",
},
Expand All @@ -66,14 +66,14 @@ Array [
`;

exports[`lists .list() should retrieve the next page 2`] = `
Array [
Object {
"_links": Object {
"documentation": Object {
[
{
"_links": {
"documentation": {
"href": "https://docs.mollie.com/reference/v2/customers-api/get-customer",
"type": "text/html",
},
"self": Object {
"self": {
"href": "https://api.mollie.com/v2/customers/cst_l4J9zsdzO",
"type": "application/hal+json",
},
Expand All @@ -87,13 +87,13 @@ Array [
"name": "Customer 4",
"resource": "customer",
},
Object {
"_links": Object {
"documentation": Object {
{
"_links": {
"documentation": {
"href": "https://docs.mollie.com/reference/v2/customers-api/get-customer",
"type": "text/html",
},
"self": Object {
"self": {
"href": "https://api.mollie.com/v2/customers/cst_CFAhWkIKz",
"type": "application/hal+json",
},
Expand All @@ -107,13 +107,13 @@ Array [
"name": "Customer 5",
"resource": "customer",
},
Object {
"_links": Object {
"documentation": Object {
{
"_links": {
"documentation": {
"href": "https://docs.mollie.com/reference/v2/customers-api/get-customer",
"type": "text/html",
},
"self": Object {
"self": {
"href": "https://api.mollie.com/v2/customers/cst_5BsP6Y1S8",
"type": "application/hal+json",
},
Expand Down
84 changes: 42 additions & 42 deletions tests/unit/resources/__snapshots__/methods.test.ts.snap
@@ -1,16 +1,16 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`methods .get() should return a method instance 1`] = `
Object {
"_links": Object {
"self": Object {
{
"_links": {
"self": {
"href": "https://api.mollie.com/v2/methods/ideal",
"type": "application/hal+json",
},
},
"description": "iDEAL",
"id": "ideal",
"image": Object {
"image": {
"size1x": "https://www.mollie.com/images/payscreen/methods/ideal.png",
"size2x": "https://www.mollie.com/images/payscreen/methods/ideal%402x.png",
},
Expand All @@ -19,16 +19,16 @@ Object {
`;

exports[`methods .get() should work with a callback 1`] = `
Object {
"_links": Object {
"self": Object {
{
"_links": {
"self": {
"href": "https://api.mollie.com/v2/methods/ideal",
"type": "application/hal+json",
},
},
"description": "iDEAL",
"id": "ideal",
"image": Object {
"image": {
"size1x": "https://www.mollie.com/images/payscreen/methods/ideal.png",
"size2x": "https://www.mollie.com/images/payscreen/methods/ideal%402x.png",
},
Expand All @@ -37,62 +37,62 @@ Object {
`;

exports[`methods .list() should return a list of all methods 1`] = `
Array [
Object {
"_links": Object {
"self": Object {
[
{
"_links": {
"self": {
"href": "https://api.mollie.com/v2/methods/ideal",
"type": "application/hal+json",
},
},
"description": "iDEAL",
"id": "ideal",
"image": Object {
"image": {
"size1x": "https://www.mollie.com/images/payscreen/methods/ideal.png",
"size2x": "https://www.mollie.com/images/payscreen/methods/ideal%402x.png",
},
"resource": "method",
},
Object {
"_links": Object {
"self": Object {
{
"_links": {
"self": {
"href": "https://api.mollie.com/v2/methods/creditcard",
"type": "application/hal+json",
},
},
"description": "Credit card",
"id": "creditcard",
"image": Object {
"image": {
"size1x": "https://www.mollie.com/images/payscreen/methods/creditcard.png",
"size2x": "https://www.mollie.com/images/payscreen/methods/creditcard%402x.png",
},
"resource": "method",
},
Object {
"_links": Object {
"self": Object {
{
"_links": {
"self": {
"href": "https://api.mollie.com/v2/methods/banktransfer",
"type": "application/hal+json",
},
},
"description": "Bank transfer",
"id": "banktransfer",
"image": Object {
"image": {
"size1x": "https://www.mollie.com/images/payscreen/methods/banktransfer.png",
"size2x": "https://www.mollie.com/images/payscreen/methods/banktransfer%402x.png",
},
"resource": "method",
},
Object {
"_links": Object {
"self": Object {
{
"_links": {
"self": {
"href": "https://api.mollie.com/v2/methods/inghomepay",
"type": "application/hal+json",
},
},
"description": "ING Home'Pay",
"id": "inghomepay",
"image": Object {
"image": {
"size1x": "https://www.mollie.com/images/payscreen/methods/inghomepay.png",
"size2x": "https://www.mollie.com/images/payscreen/methods/inghomepay%402x.png",
},
Expand All @@ -102,62 +102,62 @@ Array [
`;

exports[`methods .list() should work with a callback 1`] = `
Array [
Object {
"_links": Object {
"self": Object {
[
{
"_links": {
"self": {
"href": "https://api.mollie.com/v2/methods/ideal",
"type": "application/hal+json",
},
},
"description": "iDEAL",
"id": "ideal",
"image": Object {
"image": {
"size1x": "https://www.mollie.com/images/payscreen/methods/ideal.png",
"size2x": "https://www.mollie.com/images/payscreen/methods/ideal%402x.png",
},
"resource": "method",
},
Object {
"_links": Object {
"self": Object {
{
"_links": {
"self": {
"href": "https://api.mollie.com/v2/methods/creditcard",
"type": "application/hal+json",
},
},
"description": "Credit card",
"id": "creditcard",
"image": Object {
"image": {
"size1x": "https://www.mollie.com/images/payscreen/methods/creditcard.png",
"size2x": "https://www.mollie.com/images/payscreen/methods/creditcard%402x.png",
},
"resource": "method",
},
Object {
"_links": Object {
"self": Object {
{
"_links": {
"self": {
"href": "https://api.mollie.com/v2/methods/banktransfer",
"type": "application/hal+json",
},
},
"description": "Bank transfer",
"id": "banktransfer",
"image": Object {
"image": {
"size1x": "https://www.mollie.com/images/payscreen/methods/banktransfer.png",
"size2x": "https://www.mollie.com/images/payscreen/methods/banktransfer%402x.png",
},
"resource": "method",
},
Object {
"_links": Object {
"self": Object {
{
"_links": {
"self": {
"href": "https://api.mollie.com/v2/methods/inghomepay",
"type": "application/hal+json",
},
},
"description": "ING Home'Pay",
"id": "inghomepay",
"image": Object {
"image": {
"size1x": "https://www.mollie.com/images/payscreen/methods/inghomepay.png",
"size2x": "https://www.mollie.com/images/payscreen/methods/inghomepay%402x.png",
},
Expand Down

0 comments on commit 5f8517e

Please sign in to comment.