How to use the builders.mergeEntries function in builders

To help you get started, we’ve selected a few builders examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rtymchyk / babel-plugin-extract-text / test / builders.spec.js View on Github external
it('plural entry contains 2 msgstr', () => {
      const result = mergeEntries({}, [{
        msgid_plural: 'Many',
        msgid: 'One',
      }])

      expect(result.translations[''].One.msgstr).toEqual(['', ''])
    })
github rtymchyk / babel-plugin-extract-text / test / builders.spec.js View on Github external
it('includes default charset and headers if included', () => {
      const charset = 'UTF-8'
      const expectedHeaders = {
        'content-type': 'text/plain; charset=UTF-8',
        'plural-forms': 'nplurals=2; plural=(n!=1);',
        language: 'en_US',
      }
      const result = mergeEntries({}, [])

      expect(result.charset).toEqual(charset)
      expect(result.headers).toEqual(expectedHeaders)
    })