Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
johntyty912 opened this issue Aug 19, 2022 · 0 comments
Open

Comments

@johntyty912
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant