react-native-navigation的迁移库

Commands.test.js 631B

123456789101112131415161718192021222324252627
  1. describe('Commands', () => {
  2. let uut;
  3. const nativeCommandsSender = {
  4. startApp: jest.fn()
  5. };
  6. const uniqueIdProvider = {
  7. generate: (prefix) => `${prefix}UNIQUE`
  8. };
  9. beforeEach(() => {
  10. const Commands = require('./Commands').default;
  11. uut = new Commands(nativeCommandsSender, uniqueIdProvider);
  12. });
  13. describe('startApp', () => {
  14. it('sends startApp to native after parsing into layoutTree', () => {
  15. uut.startApp({
  16. container: {
  17. name: 'com.example.MyScreen'
  18. }
  19. });
  20. expect(nativeCommandsSender.startApp).toHaveBeenCalledTimes(1);
  21. //TODO
  22. });
  23. });
  24. });