can't we make this in an external file and require it? This will make it easier to write additional tests and share with the marionette tests.