tauricon.spec.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import * as appTestSetup from '../fixtures/app-test-setup.js'
  2. appTestSetup.initJest('app')
  3. describe('[CLI] tauri-icon internals', () => {
  4. it('tells you the version', async () => {
  5. const tauricon = (await import('api/tauricon')).default
  6. const version = tauricon.version()
  7. expect(!!version).toBe(true)
  8. })
  9. })
  10. describe('[CLI] tauri-icon builder', () => {
  11. it('will still use default compression if missing compression chosen', async () => {
  12. const tauricon = (await import('api/tauricon')).default
  13. const valid = await tauricon.make(
  14. 'test/jest/fixtures/tauri-logo.png',
  15. 'test/jest/tmp/missing',
  16. 'missing'
  17. )
  18. expect(valid).toBe(true)
  19. })
  20. it('will not validate a non-file', async () => {
  21. try {
  22. const tauricon = (await import('api/tauricon')).default
  23. await tauricon.make(
  24. 'test/jest/fixtures/tauri-foo-not-found.png',
  25. 'test/jest/tmp/optipng',
  26. 'optipng'
  27. )
  28. } catch (e) {
  29. expect(e.message).toBe('Input file is missing')
  30. }
  31. })
  32. it('makes a set of icons with optipng', async () => {
  33. const tauricon = (await import('api/tauricon')).default
  34. const valid = await tauricon.make(
  35. 'test/jest/fixtures/tauri-logo.png',
  36. 'test/jest/tmp/optipng',
  37. 'optipng'
  38. )
  39. expect(valid).toBe(true)
  40. })
  41. /*
  42. TURNED OFF BECAUSE IT TAKES FOREVER
  43. it('makes a set of icons with zopfli', async () => {
  44. jest.setTimeout(120000)
  45. const valid = await tauricon.make('test/jest/fixtures/tauri-logo.png', 'test/jest/tmp/zopfli', 'zopfli')
  46. expect(valid).toBe(true)
  47. })
  48. */
  49. })