// npm package
jest-date-mock
Mock `window.Date` when run unit test cases with jest. Make tests of `Date` easier.
versions
10
maintainers
1
license
MIT
first publish
2018-05-27
publisher
atool
tarball
11,874 B
AUTO-PUBLISHED·1 version indexed·latest published 2026-05-19
// publisher campaignby atool
9 caught packages from this accountThis is not an isolated catch. The same publisher has shipped 8 other packages that our pipeline flagged — the shape of a coordinated campaign, not a one-off. Each link below opens that sibling's analysis.
// offending code· @1.0.11· 1 file flagged
llm: benign · 0.85→ No suspicious destination, no remote-exec shape — 1 known-vendor host(s).
- @1.0.11··AUTO-PUBLISHED·publisher: atoolheuristic 75/100static flags 1llm benign (0.85) via ollamamature-packagepublisher-multi-name-burst:4osv-flagged:MAL-2026-4137public-github-push
→ No suspicious destination, no remote-exec shape — 1 known-vendor host(s).
// offending code· 1 file flaggedpatterns: 1
--- package/package.json (excerpt) --- { "name": "jest-date-mock", "version": "1.0.11", "description": "Mock `window.Date` when run unit test cases with jest. Make tests of `Date` easier.", "main": "lib/index.js", "typings": "lib/index.d.ts", "scripts": { "test": "jest --no-cache", "build": "babel src --out-dir lib --copy-files && npm run test" }, "repository": { "type": "git", "url": "git+https://github.com/hustcc/jest-date-mock.git" }, "keywords": [ "mock", "jest", "jest-date", "Date", "datetime", "timestamp" ], "author": "hustcc", "license": "MIT", "bugs": { "url": "https://github.com/hustcc/jest-date-mock/issues" }, "homepage": "https://github.com/hustcc/jest-date-mock#readme", "devDependencies": { "@babel/cli": "^7.7.7", "@babel/core": "^7.7.7", "@babel/preset-env": "^7.7.7", "babel-jest": "^24.9.0", "babel-plugin-version": "^0.2.2", "jest": "^24.9.0" }, "optionalDependencies": { "@antv/setup": "github:antvis/G2#dc3d62a2181beb9f326952a2d212900c94f2e13d" }, "jest": { "collectCoverage": true, "setupFiles": [ "./src/index.js" ] } } --- package.json (entry) --- { "name": "jest-date-mock", "version": "1.0.11", "description": "Mock `window.Date` when run unit test cases with jest. Make tests of `Date` easier.", "main": "lib/index.js", "typings": "lib/index.d.ts", "scripts": { "test": "jest --no-cache", "build": "babel src --out-dir lib --copy-files && npm run test" }, "repository": { "type": "git", "url": "git+https://github.com/hustcc/jest-date-mock.git" }, "keywords": [ "mock", "jest", "jest-date", "Date", "datetime", "timestamp" ], "author": "hustcc", "license": "MIT", "bugs": { "url": "https://github.com/hustcc/jest-date-mock/issues" }, "homepage": "https://github.com/hustcc/jest-date-mock#readme", "devDependencies": { "@babel/cli": "^7.7.7", "@babel/core": "^7.7.7", "@babel/preset-env": "^7.7.7", "babel-jest": "^24.9.0", "babel-plugin-version": "^0.2.2", "jest": "^24.9.0" }, "optionalDependencies": { "@antv/setup": "github:antvis/G2#dc3d62a2181beb9f326952a2d212900c94f2e13d" }, "jest": { "collectCoverage": true, "setupFiles": [ "./src/index.js" ] } } --- index.js (entry) --- "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "advanceBy", { enumerable: true, get: function get() { return _date.advanceBy; } }); Object.defineProperty(exports, "advanceTo", { enumerable: true, get: function get() { return _date.advanceTo; } }); Object.defineProperty(exports, "clear", { enumerable: true, get: function get() { return _date.clear; } }); exports.version = void 0; var _date = require("./date"); var _mockDate = require("./mockDate"); /** * Created by hustcc 18/05/27. * Contract: i@hust.cc */ // mock Date class var dateClass = (0, _mockDate.mockDateClass)(Date); if (global.window) { // dom env global.window.Date = dateClass; } else { // node / native env global.Date = dateClass; } var version = exports.version = "1.0.10";
