Skip to content

Commit

Permalink
Fix map unit tests and added pretest command
Browse files Browse the repository at this point in the history
  • Loading branch information
cgalvan committed Jul 18, 2024
1 parent a36c1bd commit ebf0811
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"typedoc": "typedoc",
"pretest": "node -p \"'export const PACKAGE_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts",
"test": "jest --collectCoverage --collectCoverageFrom=src/**/*.{ts,js}",
"prebuild": "node -p \"'export const PACKAGE_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts",
"build": "npm-run-all build:*",
Expand Down
2 changes: 2 additions & 0 deletions test/maps.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ test("should set migration map options", () => {
maxZoom: 18,
pitch: 45,
bearing: 90,
transformRequest: expect.any(Function),
};
expect(testMap).not.toBeNull();
expect(Map).toHaveBeenCalledTimes(1);
Expand All @@ -117,6 +118,7 @@ test("should set migration map options with control position not available in Ma
style: undefined,
center: [testLng, testLat],
zoom: 9,
transformRequest: expect.any(Function),
};
expect(testMap).not.toBeNull();
expect(Map).toHaveBeenCalledTimes(1);
Expand Down

0 comments on commit ebf0811

Please sign in to comment.