ast-utils.test.js.snap 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // Jest Snapshot v1, https://goo.gl/fbAQLP
  2. exports[`utils createIdentifierOrLiteral should create basic literal 1`] = `"'stringLiteral'"`;
  3. exports[`utils createIdentifierOrLiteral should create boolean 1`] = `"true"`;
  4. exports[`utils createLiteral should create basic literal 1`] = `"\\"stringLiteral\\""`;
  5. exports[`utils createLiteral should create boolean 1`] = `"true"`;
  6. exports[`utils createOrUpdatePluginByName should add an object as an argument 1`] = `
  7. "[new Plugin({
  8. foo: true
  9. })]"
  10. `;
  11. exports[`utils createOrUpdatePluginByName should create a new plugin with arguments 1`] = `
  12. "{ plugins: [new Plugin({
  13. foo: \\"bar\\"
  14. })] }"
  15. `;
  16. exports[`utils createOrUpdatePluginByName should create a new plugin without arguments 1`] = `"{ plugins: [new Plugin()] }"`;
  17. exports[`utils createOrUpdatePluginByName should merge options objects 1`] = `
  18. "[new Plugin({
  19. foo: true,
  20. bar: \\"baz\\",
  21. foo: false,
  22. baz-long: true
  23. })]"
  24. `;
  25. exports[`utils createProperty should create properties for Boolean 1`] = `
  26. "{
  27. foo: true
  28. }"
  29. `;
  30. exports[`utils createProperty should create properties for Number 1`] = `
  31. "{
  32. foo: -1
  33. }"
  34. `;
  35. exports[`utils createProperty should create properties for String 1`] = `
  36. "{
  37. foo: \\"bar\\"
  38. }"
  39. `;
  40. exports[`utils createProperty should create properties for complex keys 1`] = `
  41. "{
  42. foo-bar: \\"bar\\"
  43. }"
  44. `;
  45. exports[`utils createProperty should create properties for non-literal keys 1`] = `
  46. "{
  47. 1: \\"bar\\"
  48. }"
  49. `;
  50. exports[`utils findPluginsArrayAndRemoveIfEmpty It should not remove plugins array, given an array with length greater than zero 1`] = `
  51. "
  52. const a = {
  53. plugins: [
  54. new MyCustomPlugin()
  55. ]
  56. }
  57. "
  58. `;
  59. exports[`utils findPluginsArrayAndRemoveIfEmpty should remove plugins property 1`] = `
  60. "
  61. const a = {}
  62. "
  63. `;
  64. exports[`utils getRequire should create a require statement 1`] = `"const filesys = require(\\"fs\\");"`;