mumuki-javascript-runner 1.6.2 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/test_hook.rb +11 -4
- data/lib/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5584ae96f5cefe3bebfffc73f112b1e449ce5c32e3d4ff0494223c9e0b0f18e4
|
4
|
+
data.tar.gz: 92d98ddd5222726ece6dfec3a41d41c7350163d906649595db11bb8542843c7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e2d6882f17a35dd4eadac042c1f34c6785900c09b37a90e2056a8bf72247869bd9a02a95137c8edb99654e9a09df168205aeecae93013ff41682182e3476739
|
7
|
+
data.tar.gz: 5a49c40554275ed469945d858f7c27aacfc7cc83e39083580959702b12d320e5d49a2c540738a1911bea9eba38a3cb0e122bd6c7b7524425531af3424c728368
|
data/lib/test_hook.rb
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
class JavascriptTestHook < Mumukit::Templates::FileHook
|
2
2
|
isolated true
|
3
3
|
structured true, separator: '!!!JAVASCRIPT-MUMUKI-OUTPUT!!!'
|
4
|
+
line_number_offset 3, include_extra: true
|
4
5
|
|
5
6
|
def compile_file_content(request)
|
6
7
|
<<javascript
|
7
8
|
'use strict';
|
8
|
-
|
9
|
-
var assert = require('assert');
|
10
|
-
|
9
|
+
let assert = require('assert');
|
11
10
|
#{request.extra}
|
12
11
|
#{request.content}
|
13
12
|
describe('', function() {
|
@@ -32,11 +31,19 @@ javascript
|
|
32
31
|
transform(super['tests'])
|
33
32
|
end
|
34
33
|
|
34
|
+
def post_process_unstructured_result(file, result, status)
|
35
|
+
if status.errored?
|
36
|
+
[content_type.code(result.gsub(/(SyntaxError: .*\n)(.|\n)*/) { $1 }), status]
|
37
|
+
else
|
38
|
+
super
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
35
42
|
def transform(examples)
|
36
43
|
examples.map { |e| [e['fullTitle'], e['err'].present? ? :failed : :passed, parse_out(e['err'])] }
|
37
44
|
end
|
38
45
|
|
39
46
|
def parse_out(exception)
|
40
|
-
exception.present? ? exception['message'] : ''
|
47
|
+
exception.present? ? content_type.code(exception['message']) : ''
|
41
48
|
end
|
42
49
|
end
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumuki-javascript-runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franco Leonardo Bulgarelli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mumukit
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '2.
|
19
|
+
version: '2.40'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '2.
|
26
|
+
version: '2.40'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|