BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
aab60054
Commit
aab60054
authored
Jan 19, 2017
by
Fatih Acet
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'allow-shared-examples-jasmine' into 'master'
Add jasmine helpers and run their specs Closes #26305 See merge request !8437
parents
52762df2
2d2fe2cf
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
2 deletions
+48
-2
.eslintrc
spec/javascripts/.eslintrc
+3
-1
class_spec_helper.js.es6
spec/javascripts/helpers/class_spec_helper.js.es6
+9
-0
class_spec_helper_spec.js.es6
spec/javascripts/helpers/class_spec_helper_spec.js.es6
+35
-0
teaspoon_env.rb
spec/teaspoon_env.rb
+1
-1
No files found.
spec/javascripts/.eslintrc
View file @
aab60054
...
@@ -23,6 +23,8 @@
...
@@ -23,6 +23,8 @@
"plugins": ["jasmine"],
"plugins": ["jasmine"],
"rules": {
"rules": {
"prefer-arrow-callback": 0,
"prefer-arrow-callback": 0,
"func-names": 0
"func-names": 0,
"jasmine/no-suite-dupes": [1, "branch"],
"jasmine/no-spec-dupes": [1, "branch"]
}
}
}
}
spec/javascripts/helpers/class_spec_helper.js.es6
0 → 100644
View file @
aab60054
/* eslint-disable no-unused-vars */
class ClassSpecHelper {
static itShouldBeAStaticMethod(base, method) {
return it('should be a static method', () => {
expect(Object.prototype.hasOwnProperty.call(base, method)).toBeTruthy();
});
}
}
spec/javascripts/helpers/class_spec_helper_spec.js.es6
0 → 100644
View file @
aab60054
/* global ClassSpecHelper */
//= require ./class_spec_helper
describe('ClassSpecHelper', () => {
describe('.itShouldBeAStaticMethod', function () {
beforeEach(() => {
class TestClass {
instanceMethod() { this.prop = 'val'; }
static staticMethod() {}
}
this.TestClass = TestClass;
});
ClassSpecHelper.itShouldBeAStaticMethod(ClassSpecHelper, 'itShouldBeAStaticMethod');
it('should have a defined spec', () => {
expect(ClassSpecHelper.itShouldBeAStaticMethod(this.TestClass, 'staticMethod').description).toBe('should be a static method');
});
it('should pass for a static method', () => {
const spec = ClassSpecHelper.itShouldBeAStaticMethod(this.TestClass, 'staticMethod');
expect(spec.status()).toBe('passed');
});
it('should fail for an instance method', (done) => {
const spec = ClassSpecHelper.itShouldBeAStaticMethod(this.TestClass, 'instanceMethod');
spec.resultCallback = (result) => {
expect(result.status).toBe('failed');
done();
};
spec.execute();
});
});
});
spec/teaspoon_env.rb
View file @
aab60054
...
@@ -166,7 +166,7 @@ Teaspoon.configure do |config|
...
@@ -166,7 +166,7 @@ Teaspoon.configure do |config|
# Assets to be ignored when generating coverage reports. Accepts an array of filenames or regular expressions. The
# Assets to be ignored when generating coverage reports. Accepts an array of filenames or regular expressions. The
# default excludes assets from vendor, gems and support libraries.
# default excludes assets from vendor, gems and support libraries.
coverage
.
ignore
=
[
%r{vendor/}
,
%r{spec/}
]
coverage
.
ignore
=
[
%r{vendor/}
,
%r{spec/
javascripts/(?!helpers/)
}
]
# Various thresholds requirements can be defined, and those thresholds will be checked at the end of a run. If any
# Various thresholds requirements can be defined, and those thresholds will be checked at the end of a run. If any
# aren't met the run will fail with a message. Thresholds can be defined as a percentage (0-100), or nil.
# aren't met the run will fail with a message. Thresholds can be defined as a percentage (0-100), or nil.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment