Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
49 changes: 45 additions & 4 deletions jest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,49 @@
export default {
preset: "ts-jest",
testEnvironment: "node",
moduleNameMapper: {
"(.+)\.js$": "$1",
},
workerThreads: true,
projects: [
{
displayName: "unit",
preset: "ts-jest",
testEnvironment: "node",
moduleNameMapper: {
"^(\.{1,2}/.*)\.js$": "$1",
},
roots: ["<rootDir>/tests"],
testPathIgnorePatterns: ["\.browser\.(spec|test)\.[jt]sx?$", "/tests/wire/", "/tests/integration/"],
setupFilesAfterEnv: [],
},
{
displayName: "browser",
preset: "ts-jest",
testEnvironment: "<rootDir>/tests/BrowserTestEnvironment.ts",
moduleNameMapper: {
"^(\.{1,2}/.*)\.js$": "$1",
},
roots: ["<rootDir>/tests"],
testMatch: ["<rootDir>/tests/unit/**/?(*.)+(browser).(spec|test).[jt]s?(x)"],
setupFilesAfterEnv: [],
},
{
displayName: "wire",
preset: "ts-jest",
testEnvironment: "node",
moduleNameMapper: {
"^(\.{1,2}/.*)\.js$": "$1",
},
roots: ["<rootDir>/tests/wire"],
setupFilesAfterEnv: ["<rootDir>/tests/mock-server/setup.ts"],
},
{
displayName: "integration",
preset: "ts-jest",
testEnvironment: "node",
moduleNameMapper: {
"^(\.{1,2}/.*)\.js$": "$1",
},
roots: ["<rootDir>/tests/integration"],
},
],
workerThreads: false,
passWithNoTests: true,
};
29 changes: 17 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,55 @@
{
"name": "square",
"version": "43.0.1",
"version": "42.1.0.20250521",
"private": false,
"repository": "https://github.com/square/square-nodejs-sdk",
"repository": "github:square/square-nodejs-sdk",
"license": "MIT",
"main": "./index.js",
"types": "./index.d.ts",
"scripts": {
"format": "prettier . --write --ignore-unknown",
"build": "tsc",
"prepack": "cp -rv dist/. .",
"test": "yarn test:unit",
"test:unit": "jest --testPathPattern=tests/unit",
"test:integration": "jest --testPathPattern=tests/integration"
"test": "jest --selectProjects unit browser wire",
"test:unit": "jest --selectProjects unit",
"test:browser": "jest --selectProjects browser",
"test:wire": "jest --selectProjects wire",
"test:integration": "jest --selectProjects integration"
},
"dependencies": {
"url-join": "4.0.1",
"form-data": "^4.0.0",
"formdata-node": "^6.0.3",
"node-fetch": "^2.7.0",
"qs": "^6.13.1",
"readable-stream": "^4.5.2",
"js-base64": "3.7.7",
"form-data-encoder": "^4.0.2",
"square-legacy": "npm:square@^39.1.1"
},
"devDependencies": {
"@types/url-join": "4.0.1",
"@types/qs": "^6.9.17",
"@types/node-fetch": "^2.6.12",
"@types/readable-stream": "^4.0.18",
"webpack": "^5.97.1",
"ts-loader": "^9.5.1",
"jest": "^29.7.0",
"@jest/globals": "^29.7.0",
"@types/jest": "^29.5.14",
"ts-jest": "^29.1.1",
"ts-jest": "^29.3.4",
"jest-environment-jsdom": "^29.7.0",
"msw": "^2.8.4",
"@types/node": "^18.19.70",
"prettier": "^3.4.2",
"typescript": "~5.7.2"
},
"browser": {
"fs": false,
"os": false,
"path": false
"path": false,
"stream": false
},
"packageManager": "[email protected]",
"engines": {
"node": ">=18.0.0"
},
"sideEffects": false,
"description": "Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.",
"author": {
"name": "Square Developer Platform",
Expand Down
Loading
Loading