react-native-navigation的迁移库

index.test.js 411B

1234567891011121314151617
  1. jest.mock('./Navigation', () => ({ startApp: () => 'import' }));
  2. import Navigation from './index';
  3. describe('index', () => {
  4. let uut;
  5. beforeEach(() => {
  6. jest.mock('./Navigation', () => ({ startApp: () => 'require' }));
  7. uut = require('./index');
  8. });
  9. it('exposes Navigation', () => {
  10. expect(uut.startApp()).toEqual('require');
  11. expect(Navigation.startApp()).toEqual('import');
  12. });
  13. });