Skip to content

How can I test ignore the format of generate code and actual code? #29

Open
@johntyty912

Description

@johntyty912

Here's the test case:

@ShouldGenerate(
  '''class shouldHaveTheCorrectAddressAndPathImpl implements shouldHaveTheCorrectAddressAndPath {
  Socket socket = io('https://api.robocore.ai', {
        'path': '/remote',
        'transports': ['websocket'],
        'forceNew': true,
      });
  }''',
  contains: true,
  expectedLogItems: [
    'onEventElements: 0',
    'emitEventElements: 0',
    'eventListenersElements: 0',
  ],
)
@SocketIoClient(address: "https://api.robocore.ai", path: "/remote")
class shouldHaveTheCorrectAddressAndPath {}

And It can't pass:

Expected: contains 'class shouldHaveTheCorrectAddressAndPathImpl implements shouldHaveTheCorrectAddressAndPath {\n'
            '  Socket socket = io(\'https://api.robocore.ai\', {\n'
            '        \'path\': \'/remote\',\n'
            '        \'transports\': [\'websocket\'],\n'
            '        \'forceNew\': true,\n'
            '      });\n'
            '  }'
  Actual: 'class shouldHaveTheCorrectAddressAndPathImpl\n'
            '    implements shouldHaveTheCorrectAddressAndPath {\n'
            '  Socket socket = io(\'https://api.robocore.ai\', {\n'
            '    \'path\': \'/remote\',\n'
            '    \'transports\': [\'websocket\'],\n'
            '    \'forceNew\': true,\n'
            '  });\n'
            '}\n'
            ''

The actual one is almosts the same with the expected, I want to know how to just ignore the format???
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions