mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 13:25:19 +00:00
Converted specs to esm
This commit is contained in:
@@ -4,9 +4,9 @@
|
|||||||
* @type {import("jest").Config}
|
* @type {import("jest").Config}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module.exports = {
|
export default {
|
||||||
moduleFileExtensions: ["js", "mjs", "cjs"],
|
moduleFileExtensions: ["js", "mjs", "cjs"],
|
||||||
testEnvironment: "node",
|
testEnvironment: "node",
|
||||||
testMatch: ["**/specs/**/*.spec.cjs"],
|
testMatch: ["**/specs/**/*.spec.mjs"],
|
||||||
injectGlobals: false,
|
injectGlobals: false,
|
||||||
};
|
};
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
"build:dual": "pnpm tsconfig-to-dual-package tsconfig.esm.json tsconfig.cjs.json",
|
"build:dual": "pnpm tsconfig-to-dual-package tsconfig.esm.json tsconfig.cjs.json",
|
||||||
"build:all": "pnpm build && pnpm build:examples",
|
"build:all": "pnpm build && pnpm build:examples",
|
||||||
"prepublishOnly": "pnpm build && pnpm test",
|
"prepublishOnly": "pnpm build && pnpm test",
|
||||||
"test": "NODE_OPTIONS=\"--experimental-vm-modules --no-warnings\" pnpm jest -c jest.config.cjs --silent"
|
"test": "NODE_OPTIONS=\"--experimental-vm-modules --no-warnings\" pnpm jest -c jest.config.mjs --silent"
|
||||||
},
|
},
|
||||||
"author": "Alexander Patrick Cerutti",
|
"author": "Alexander Patrick Cerutti",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -1,15 +1,12 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
const {
|
import { beforeEach, beforeAll, expect, it, describe } from "@jest/globals";
|
||||||
beforeEach,
|
import fs from "node:fs";
|
||||||
beforeAll,
|
import path from "node:path";
|
||||||
expect,
|
import { fileURLToPath } from "node:url";
|
||||||
it,
|
import forge from "node-forge";
|
||||||
describe,
|
import { PKPass } from "passkit-generator";
|
||||||
} = require("@jest/globals");
|
|
||||||
const fs = require("node:fs");
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||||
const path = require("node:path");
|
|
||||||
const forge = require("node-forge");
|
|
||||||
const { default: PKPass } = require("../lib/PKPass");
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {[cert: Buffer, key: Buffer]}
|
* @returns {[cert: Buffer, key: Buffer]}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
const { describe, expect, it } = require("@jest/globals");
|
import { describe, expect, it } from "@jest/globals";
|
||||||
const { processDate, removeHidden } = require("../lib/utils");
|
import { processDate, removeHidden } from "../lib/esm/utils.js";
|
||||||
|
|
||||||
describe("Utils", () => {
|
describe("Utils", () => {
|
||||||
describe("removeHidden", () => {
|
describe("removeHidden", () => {
|
||||||
Reference in New Issue
Block a user