manyOutputs.ts 968 B

12345678910111213141516171819202122232425262728293031323334
  1. /**
  2. * Copyright (c) Jupyter Development Team.
  3. * Distributed under the terms of the Modified BSD License.
  4. */
  5. import makeNotebook from './makeNotebook';
  6. import NotebookType from './notebookType';
  7. export default {
  8. label: '100 n outputs each of a div',
  9. waitFor: async () => null,
  10. notebook: (n: number) =>
  11. makeNotebook([
  12. {
  13. cell_type: 'code',
  14. execution_count: 1,
  15. metadata: {},
  16. outputs: Array.from({ length: n * 100 }, (_, i) => ({
  17. data: {
  18. 'text/plain': [
  19. `'I am a long string which is repeatedly added to the dom: ${i}'`
  20. ]
  21. },
  22. metadata: {},
  23. output_type: 'display_data'
  24. })),
  25. source: [
  26. 'from IPython.display import display\n',
  27. '\n',
  28. `for i in range(${n * 100}):\n`,
  29. " display('I am a long string which is repeatedly added to the dom: %d' % i)"
  30. ]
  31. }
  32. ])
  33. } as NotebookType;