Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All test suites failed to run since 1.0.0 #239

Closed
alanjaouen opened this issue Jul 20, 2021 · 1 comment · Fixed by #240
Closed

All test suites failed to run since 1.0.0 #239

alanjaouen opened this issue Jul 20, 2021 · 1 comment · Fixed by #240
Assignees

Comments

@alanjaouen
Copy link

Description

Since Release 1.0.0, none of my tests pass, there is an exemple with a really simple one

Steps to Reproduce

// simplified test case
it('Component rendered', () => {
        const element = createElement('c-info-GSL', {
            is: InfoGSL
        });
        document.body.appendChild(element);

        expect(element.shadowRoot.querySelector("lightning-record-view-form")).not.toBeNull();
    });
<!-- HTML for component under test -->
<template>
    <div class="acc-container">
        <lightning-record-view-form record-id={recordId} object-api-name="Account">
            <div class="slds-grid">
                <div class="slds-col slds-size_1-of-2">
                    <lightning-output-field field-name="ID_SL__c"></lightning-output-field>
                </div>
                <div class="slds-col slds-size_1-of-2">
                    <lightning-output-field field-name="Price__c"></lightning-output-field>
                </div>
            </div>
        </lightning-record-view-form>
    </div>
</template>
// JS for component under test
import { LightningElement,api } from 'lwc';
 
export default class AccInfoGSL extends LightningElement {
    @api recordId;
}
// Jest config overrides (if any)
# Command to repro
sfdx-lwc-jest -- --no-cache

Expected Results

pass

Actual Results

TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined

      at Object.getCacheKey (node_modules/@lwc/jest-transformer/src/index.js:116:14)
      at ScriptTransformer._getCacheKey (node_modules/@jest/transform/build/ScriptTransformer.js:280:41)
      at ScriptTransformer._getFileCachePath (node_modules/@jest/transform/build/ScriptTransformer.js:351:27)
      at ScriptTransformer.transformSource (node_modules/@jest/transform/build/ScriptTransformer.js:588:32)
      at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:758:40)
      at ScriptTransformer.transform (node_modules/@jest/transform/build/ScriptTransformer.js:815:19)

Version

  • @salesforce/sfdx-lwc-jest: 1.0.0
  • Node: 15.4.0

Possible Solution

Additional context/Screenshots

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants