This is my js file
import React, { Component } from 'react';
export default class ProjectStore extends Component {
static lodingCount = 0;
constructor(props) {
super(props);
}
static setLodingCount(countValue){
ProjectStore.lodingCount = countValue;
}
static getLodingCount(){
return ProjectStore.lodingCount;
}
}
I wrote a test case for the same like below:
import React from 'react';
import {shallow} from 'enzyme';
import ProjectStore from '../projectStore.js';
describe('<ProjectStore />', () => {
it('should return loading count', () => {
const ProjectStore = shallow(<ProjectStore />);
ProjectStore.setLodingCount(2);
expect(ProjectStore.lodingCount).toEqual(2);
});
});
but when I executed npm test
it returned:
ReferenceError: ProjectStore is not defined
What am I doing wrong here?