Skip to content

Commit

Permalink
Merge pull request #3 from DuncanMcPherson/autoMocker-init
Browse files Browse the repository at this point in the history
Auto mocker init
  • Loading branch information
DuncanMcPherson authored Dec 23, 2023
2 parents 2d14304 + ed0f6c0 commit 3df1a96
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ez-budgets/karma-test-utils",
"version": "1.0.0",
"version": "1.0.2",
"description": "Karma unit testing helpers",
"main": "dist/index.js",
"module": "index.mjs",
Expand Down Expand Up @@ -40,4 +40,4 @@
"ts-node": "^10.9.2",
"typescript": "^5.3.3"
}
}
}
28 changes: 28 additions & 0 deletions src/update-version.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const fs = require("fs")

// DO NOT DELETE THIS FILE

function main() {
const source = fs.readFileSync("C:/Users/Duncan McPherson/WebstormProjects/karma-test-utils/package.json").toString("utf-8");
const sourceObj = JSON.parse(source);
const version = sourceObj.version;

const versionParts = version.split('.');
let patchVersion = +versionParts[2];
let minorVersion = +versionParts[1];
let majorVersion = +versionParts[0];
if (patchVersion++ >= 10) {
minorVersion++;
patchVersion = 0;
}
if (minorVersion === 10) {
majorVersion++;
minorVersion = 0;
}
const newVersion = `${majorVersion}.${minorVersion}.${patchVersion}`
sourceObj.version = newVersion;
console.log("new version:", newVersion)
fs.writeFileSync("C:/Users/Duncan McPherson/WebstormProjects/karma-test-utils/package.json", Buffer.from(JSON.stringify(sourceObj, null, 2), "utf-8"));
}

main();
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": false,
"skipLibCheck": true
"skipLibCheck": true,
"moduleResolution": "NodeNext"
},
"include": [
"src/**/*"
],
"exclude": [
"src/**/*.spec.ts"
],
]
}

0 comments on commit 3df1a96

Please sign in to comment.