Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

system.spec.js 1015B

12345678910111213141516171819202122232425
  1. import { expect, test } from 'vitest'
  2. import { System } from '../src/system.js'
  3. test('system - instantiates and stores inventory correctly', () => {
  4. let testSystem = new System()
  5. testSystem.add('aaa', ['input_test', 'output_test', { id: 'aaa' }])
  6. expect(testSystem.inputs).toStrictEqual(['input_test'])
  7. expect(testSystem.outputs).toStrictEqual(['output_test'])
  8. expect(testSystem.containers[0].id).toStrictEqual('aaa')
  9. // Make sure inputs and outputs get reassigned
  10. testSystem.replaceContainer({ id: 'aaa' })
  11. expect(testSystem.inputs).toStrictEqual(['input_test'])
  12. expect(testSystem.outputs).toStrictEqual(['output_test'])
  13. expect(testSystem.containers[0].id).toStrictEqual('aaa')
  14. const inputs = testSystem.inputsFor({ id: 'aaa' })
  15. expect(inputs).toStrictEqual('input_test')
  16. const outputs = testSystem.outputsFor({ id: 'aaa' })
  17. expect(outputs).toStrictEqual('output_test')
  18. testSystem.remove('aaa')
  19. expect(testSystem.inventory).toStrictEqual({})
  20. })