When running the Jest test I'm getting this error: Invalid sourceApiVersion found in sfdx-project.json. Expected 47.0, found 48.0 error
My sfdx-project.json looks like this
{
"packageDirectories": [
{
"path": "force-app",
"default": true
}
],
"namespace": "",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "48.0"
}
HTML for component under test
<template>
<div class="message">Hello World!</div>
</template>
Js for component under test
import { LightningElement } from 'lwc';
export default class Modal extends LightningElement {}
Simplified Jest test
import { createElement } from "lwc";
import Modal from "c/modal";
describe("c-test-jest initialize", () => {
it("message should be initialization", () => {
// Setup
const modal = initElement();
// Exercise
return Promise.resolve().then(() => {
// Verify
expect(modal.shadowRoot.querySelector(".message")).not.toBeNull();
});
});
// HELPER
function initElement() {
let element = createElement("c-modal", {
is: Modal
});
document.body.appendChild(element);
return element;
}
});