Sha256: 9a3311e37255a437e32bfac091be9dc861dcba8efc361b4930514a0e1d611f83

Contents?: true

Size: 1.23 KB

Versions: 17

Compression:

Stored size: 1.23 KB

Contents

/* global test expect, describe */

const { chdirCwd, chdirTestApp, resetEnv } = require('../utils/helpers')

chdirTestApp()

const config = require('../config')

describe('Config', () => {
  beforeEach(() => jest.resetModules() && resetEnv())
  afterAll(chdirCwd)

  test('public path', () => {
    process.env.RAILS_ENV = 'development'
    const config = require('../config')
    expect(config.publicPath).toEqual('/packs/')
  })

  test('public path with asset host', () => {
    process.env.RAILS_ENV = 'development'
    process.env.WEBPACKER_ASSET_HOST = 'http://foo.com/'
    const config = require('../config')
    expect(config.publicPath).toEqual('http://foo.com/packs/')
  })

  test('should return extensions as listed in app config', () => {
    expect(config.extensions).toEqual([
      '.mjs',
      '.js',
      '.sass',
      '.scss',
      '.css',
      '.module.sass',
      '.module.scss',
      '.module.css',
      '.png',
      '.svg',
      '.gif',
      '.jpeg',
      '.jpg'
    ])
  })

  test('should return static assets extensions as listed in app config', () => {
    expect(config.static_assets_extensions).toEqual([
      '.jpg',
      '.jpeg',
      '.png',
      '.gif',
      '.tiff',
      '.ico',
      '.svg',
    ])
  })
})

Version data entries

17 entries across 17 versions & 5 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/@rails/webpacker/package/__tests__/config.js
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/@rails/webpacker/package/__tests__/config.js
webpacker-4.3.0 package/__tests__/config.js
enju_library-0.3.8 spec/dummy/node_modules/@rails/webpacker/package/__tests__/config.js
webpacker-5.1.1 package/__tests__/config.js
webpacker-5.1.0 package/__tests__/config.js
webpacker-5.0.1 package/__tests__/config.js
webpacker-5.0.0 package/__tests__/config.js
jetpacker-0.4.2 package/__tests__/config.js
jetpacker-0.4.1 package/__tests__/config.js
jetpacker-0.4.0 package/__tests__/config.js
jetpacker-0.3.0 package/__tests__/config.js
jetpacker-0.2.0 package/__tests__/config.js
webpacker-4.2.2 package/__tests__/config.js
webpacker-4.2.1 package/__tests__/config.js
webpacker-4.2.0 package/__tests__/config.js
webpacker-4.1.0 package/__tests__/config.js