Skip to content

Commit

Permalink
reword skip condition
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoDF committed Jul 28, 2024
1 parent 579b76b commit c779c12
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/02.04-model-mock-native.test.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import { describe, test, mock, before, after } from "node:test";
import assert from "node:assert/strict";

/**
* mock.module() was added in 22.3.0
*/
const isNode22Point3OrLower = (() => {
// mock.module() was added in 22.3.0
const supportsMockModule = (() => {
const [major, minor, _patch] = process.versions.node.split(".");
return !(parseInt(major, 10) >= 22 && parseInt(minor, 10) >= 3);
return parseInt(major, 10) >= 22 && parseInt(minor, 10) >= 3;
})();

let Model;
/** @type {ReturnType<typeof mock['module']>}*/
let modelMock;
describe("Class extends Mock - native", { skip: isNode22Point3OrLower }, () => {
describe("Class extends Mock - native", { skip: !supportsMockModule }, () => {
before(async () => {
modelMock = mock.module("sequelize", {
namedExports: {
Expand Down

0 comments on commit c779c12

Please sign in to comment.