<commit_before>import Pure from '../../src/';

const nextProps = {
  propVal: 1
};
const nextState = {
  stateVal: 2
};
const currState = {
  stateVal: 1
};
const currProps = {
  propVal: 2
};

@Pure()
class MyComponent {
  constructor(state, props){
    this.state = state;
    this.props = props;
  }
}

describe('Pure', () => {
  var mc = new MyComponent(currState, currProps);

  it('should attach shouldComponentUpdate to the class', () => {
      expect(MyComponent.prototype.shouldComponentUpdate).to.exist;
    });

  it('should not update when nextState and nextProps are the same as current state and props', () => {
    expect(mc.shouldComponentUpdate(currProps, currState)).to.be.equal(false);
  });

  it('should update when nextState is different than currState but nextProps and currProps are the same', () => {
    expect(mc.shouldComponentUpdate(currProps, nextState)).to.be.equal(true);
  });

  it('should update if state is undefined and currProps is different than nextProps', () => {

  });

});<commit_msg>testing complete<commit_after>import Pure from '../../src/';

const nextProps = {
  propVal: 1
};
const nextState = {
  stateVal: 2
};
const currState = {
  stateVal: 1
};
const currProps = {
  propVal: 2
};

@Pure()
class MyComponent {
  constructor(state, props){
    this.state = state;
    this.props = props;
  }
}

describe('Pure', () => {
  var mc = new MyComponent(currState, currProps);

  it('should attach shouldComponentUpdate to the class', () => {
      expect(MyComponent.prototype.shouldComponentUpdate).to.exist;
    });

  it('should not update when nextState and nextProps are the same as current state and props', () => {
    expect(mc.shouldComponentUpdate(currProps, currState)).to.be.equal(false);
  });

  it('should update when nextState is different than currState but nextProps and currProps are the same', () => {
    expect(mc.shouldComponentUpdate(currProps, nextState)).to.be.equal(true);
  });

  it('should update if state is undefined and currProps is different than nextProps', () => {
    mc = new MyComponent();
    mc.props = currProps;
    expect(mc.shouldComponentUpdate(nextProps, nextState)).to.be.equal(true);
  });

  it('should update if props is undefined but currState is different than nextState', () => {
    mc = new MyComponent();
    mc.state = currState;
    expect(mc.shouldComponentUpdate(nextProps, nextState)).to.be.equal(true);
  });
});
{'fraction_non_alphanumeric': 0.14026402640264027, 'fraction_numerical': 0.0033003300330033004, 'mean_word_length': 3.938900203665988, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1634028', 'n_tokens_mistral': 750, 'n_tokens_neox': 742, 'n_words': 203}