mumuki-javascript-runner 1.6.1 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/javascript_runner.rb +1 -1
- data/lib/test_hook.rb +11 -4
- data/lib/validation_hook.rb +1 -1
- data/lib/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab49ca4f76e576d54ef38fbe359f3fe12f469de411185da6b098eb7da1de874e
|
4
|
+
data.tar.gz: 1167c0ead6b71df63a5fecebaea85f66f185922bba34350089acf51018248e2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8db147e3d0892dcef9a1a07954482277ba8c487e8cb7e27ea2350775ee4cf05283d0c2ed74872e114a1698b840962c46cb85ebfc6c7a3dbba6209ad14c1f3f3c
|
7
|
+
data.tar.gz: 1067f1dfbe07d1f623f97f8c9fc51d0c51a8ce30b9a4ee906199fd122444d37d450988b2b4e019a9fd3fd66f8633edbf79a01cc9c5341a277ab8ad414790e9b6
|
data/lib/javascript_runner.rb
CHANGED
@@ -4,7 +4,7 @@ I18n.load_translations_path File.join(__dir__, 'locales', '*.yml')
|
|
4
4
|
|
5
5
|
Mumukit.runner_name = 'javascript'
|
6
6
|
Mumukit.configure do |config|
|
7
|
-
config.docker_image = 'mumuki/mumuki-mocha-worker'
|
7
|
+
config.docker_image = 'mumuki/mumuki-mocha-worker:2.0'
|
8
8
|
config.structured = true
|
9
9
|
config.stateful = true
|
10
10
|
config.content_type = 'markdown'
|
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/validation_hook.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
class JavascriptValidationHook < Mumukit::Hook
|
2
2
|
def validate!(request)
|
3
3
|
matches = request_matches?(request) do |it|
|
4
|
-
it =~ /(
|
4
|
+
it =~ /(^|[^_[[:alnum:]]]+)(require|process|os|fs|eval|cluster|v8|vm|tty|tls|root|global|crypto|stream|events)([^_[[:alnum:]]]+|$)/
|
5
5
|
end
|
6
6
|
raise Mumukit::RequestValidationError, "You can not use #{$2} here" if matches
|
7
7
|
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.9.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: 2022-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mumukit
|
@@ -16,28 +16,28 @@ 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
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '2.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '2.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -132,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
132
|
- !ruby/object:Gem::Version
|
133
133
|
version: '0'
|
134
134
|
requirements: []
|
135
|
-
rubygems_version: 3.0.
|
135
|
+
rubygems_version: 3.0.3
|
136
136
|
signing_key:
|
137
137
|
specification_version: 4
|
138
138
|
summary: Javascript Runner for Mumuki
|