Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

12345678910111213141516171819
  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. testSystem.remove('aaa')
  15. expect(testSystem.inventory).toStrictEqual({})
  16. })