Sha256: 895286aecc24787bd97f9f7ec128f83d19e7e1ab4f9e946d40994b0687b90e4d

Contents?: true

Size: 921 Bytes

Versions: 26

Compression:

Stored size: 921 Bytes

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 additional paths as listed in app config, with resolved paths', () => {
    expect(config.additional_paths).toEqual([
      'app/assets',
      '/etc/yarn',
      'some.config.js',
      'app/elm'
    ])
  })
})

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
shakapacker-6.1.1 package/__tests__/config.js
shakapacker-6.1.0 package/__tests__/config.js
shakapacker-6.1.0.beta.0 package/__tests__/config.js
shakapacker-6.0.2 package/__tests__/config.js
shakapacker-6.0.1 package/__tests__/config.js
shakapacker-6.0.0 package/__tests__/config.js
shakapacker-6.0.0.rc.14 package/__tests__/config.js
shakapacker-6.0.0.rc.13 package/__tests__/config.js
shakapacker-6.0.0.rc.12 package/__tests__/config.js
shakapacker-6.0.0.rc.6 package/__tests__/config.js
webpacker-6.0.0.rc.6 package/__tests__/config.js
webpacker-6.0.0.rc.5 package/__tests__/config.js
webpacker-6.0.0.rc.4 package/__tests__/config.js
webpacker-6.0.0.rc.3 package/__tests__/config.js
webpacker-6.0.0.rc.2 package/__tests__/config.js
webpacker-6.0.0.rc.1 package/__tests__/config.js
webpacker-6.0.0.beta.7 package/__tests__/config.js
webpacker-6.0.0.beta.6 package/__tests__/config.js
webpacker-6.0.0.beta.5 package/__tests__/config.js
webpacker-6.0.0.beta.4 package/__tests__/config.js