I have a function that is declared within my default class (constructor) that I would like to export to a Jest test suite. Is this possible?
testLWC.js
import { LightningElement } from 'lwc';
export default class JMRTestLWC extends LightningElement {
sum(a, b) {
return a + b;
}
}
testLWC.test.js
import { sum } from 'c/jMRTestLWC'
describe('Addition Suite.', () => {
test('Properly sum two numbers.', () => {
const num = 1+2;
expect(sum(1,2)).toBe(3);
})
})