Skip to content

Instantly share code, notes, and snippets.

@melv-n
melv-n / Main.cs
Last active October 28, 2016 11:07
using UnityEngine;
using UnityEngine.UI;
public class Main : Button {
void OnGUI() {
// Q: Enter PointerLock state
if (Input.GetKeyDown(KeyCode.Q)) {
EnterPointerLock();
}
@melv-n
melv-n / CustomComponent-test.js
Last active November 9, 2021 09:32
Testing React-Intl components with Enzyme's mount() and shallow() methods. This is a helper function which wraps the `intl` context around your component tests in an easy and efficient way.
import { mountWithIntl } from 'helpers/intl-enzyme-test-helper.js';
const wrapper = mountWithIntl(
<CustomComponent />
);
expect(wrapper.state('foo')).to.equal('bar'); // OK
expect(wrapper.text()).to.equal('Hello World!'); // OK