Coveralls logob
Coveralls logo
  • Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sergei-maertens / django-systemjs / 131

29 Aug 2016 - 13:38 coverage: 96.739% (+1.3%) from 95.443%
131

Pull #18

travis-ci

9181eb84f9c35729a3bad740fb7f9d93?size=18&default=identiconweb-flow
Catch error output from jspm api & raise error
Pull Request #18: Feature/more efficient bundling

291 of 297 new or added lines in 9 files covered. (97.98%)

534 of 552 relevant lines covered (96.74%)

11.56 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.83
/systemjs/conf.py
1
from __future__ import unicode_literals
12×
2

3
import os
12×
4

5
from django.conf import settings
12×
6
from django.core.exceptions import ImproperlyConfigured
12×
7

8
from appconf import AppConf
12×
9

10

11
class SystemJSConf(AppConf):
12×
12
    # Main switch
13
    ENABLED = not settings.DEBUG
12×
14

15
    # Path to JSPM executable. Must be on the path, or a full path
16
    JSPM_EXECUTABLE = 'jspm'
12×
17

18
    OUTPUT_DIR = 'SYSTEMJS'
12×
19

20
    CACHE_DIR = None
12×
21

22
    PACKAGE_JSON_DIR = getattr(settings, 'BASE_DIR', None)
12×
23

24
    DEFAULT_JS_EXTENSIONS = True
12×
25

26
    class Meta:
12×
27
        prefix = 'systemjs'
12×
28

29
    def configure_package_json_dir(self, value):
12×
30
        if value is None:
12×
31
            raise ImproperlyConfigured(
12×
32
                "Tried auto-guessing the location of 'package.json', "
33
                "but settings.BASE_DIR does not exist. Either set BASE_DIR "
34
                "or SYSTEMJS_PACKAGE_JSON_DIR"
35
            )
36
        return os.path.abspath(value)
12×
37

38
    def configure_cache_dir(self, value):
12×
39
        base_dir = getattr(settings, 'BASE_DIR', None)
12×
40
        if not base_dir:
12×
NEW
41
            raise ImproperlyConfigured(
!
42
                "Tried to set a default cache directory. Either set BASE_DIR "
43
                "or SYSTEMJS_CACHE_DIR"
44
            )
45
        value = os.path.join(base_dir, '_cache', 'systemjs')
12×
46
        return os.path.abspath(value)
12×
Troubleshooting · Open an Issue · Sales · Support · ENTERPRISE · CAREERS · STATUS
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2023 Coveralls, Inc