source_gen_test
source_gen_test copied to clipboard
How can I test ignore the format of generate code and actual code?
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