We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Using jest:
foo.test.js
import {useStrict, observable} from 'mobx'; it('should throw an exception', () => { expect(()=>{ let foo = observable.map(); useStrict(true); foo.set('foo','foo'); }).toThrow(); //no exception is thrown });
The text was updated successfully, but these errors were encountered:
it('should throw an exception 2', () => { useStrict(true); class Foo { @observable foo = ''; } expect(()=>{ let foo = new Foo(); foo.foo = 'bar'; }).toThrow(); //no exception is thrown });
Sorry, something went wrong.
In short strict mode doesn't throw unless the observable is observed by something (autorun/reaction). For more info see this and #798
No branches or pull requests
Using jest:
foo.test.js
The text was updated successfully, but these errors were encountered: