Generation

testsMon, 14 Nov 2022

function(state) { return state.createEntity.cancelItems.map((i) => i.bookingItemId }

import unittest class TestFunction(unittest.TestCase): def test_function(self): state = { createEntity: { cancelItems: [ { bookingItemId: 1, }, { bookingItemId: 2, }, ], }, } self.assertEqual(function(state), [1, 2])

Questions about programming?Chat with your personal AI assistant