Skip to content
This repository was archived by the owner on Jan 2, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions .github/workflows/test.yaml → .github/workflows/js.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: test
name: js
on:
pull_request:
push:
branches: [master]
jobs:
js:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -20,3 +20,19 @@ jobs:
run: npm ci
- name: Test JavaScript
run: npm test
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm
- name: Use Node.js ${{ steps.nvm.outputs.NVMRC }}
uses: actions/setup-node@v1
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
- name: Install dependencies
run: npm ci
- name: Lint JavaScript
run: npx gulp js:lint
6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/jsLibraryMappings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 85 additions & 0 deletions .idea/jsLinters/jshint.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"node": true
}
2 changes: 1 addition & 1 deletion dist/multiselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@

/**
* @name AmoMultiselectFactory#_optionsRegularExpression
*
*
* @description
* Options attribute value regular expression
*
Expand Down
9 changes: 6 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ gulp.task('all', 'Build application', [
'css:app',
'js:app',
'js:libs',
'js:lint'
]);

gulp.task('dist', 'Build multiselect', [
Expand Down Expand Up @@ -108,9 +107,13 @@ gulp.task('js:libs', 'Compile third party JavaScript', function() {
});

gulp.task('js:lint', 'Run JSHint to check for JavaScript code quality', function() {
gulp.src(js.src.app)
gulp.src(js.src.app.concat([
'*.js',
'tests/**/*.js'
]))
.pipe(gulpJshint())
.pipe(gulpJshint.reporter('default'));
.pipe(gulpJshint.reporter('default'))
.pipe(gulpJshint.reporter('fail'));
});

gulp.task('serve', 'Run a local webserver', function() {
Expand Down
4 changes: 2 additions & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ module.exports = function(config) {
autoWatch: true,
browsers: ['ChromeHeadless'],
singleRun: false
})
}
});
};
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/lib/multiselect.factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

/**
* @name AmoMultiselectFactory#_optionsRegularExpression
*
*
* @description
* Options attribute value regular expression
*
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/multiselect.directive.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ describe('amoMultiselect', function() {
amoMultiselectFactoryInstanceSpy.getOptionsExpression.and.returnValue('options');

amoMultiselectFactoryInstanceSpy.getLabel.and.callFake(function(option) {
return 'LABEL ' + option
return 'LABEL ' + option;
});

amoMultiselectFactoryInstanceSpy.getValue.and.callFake(function(option) {
return 'VALUE ' + option
return 'VALUE ' + option;
});
});

Expand Down
6 changes: 3 additions & 3 deletions tests/lib/multiselect.factory.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ describe('AmoMultiselectFactory', function() {
expect(result).toEqual({
key: 2,
group: 'A'
})
});
});
});

Expand All @@ -327,7 +327,7 @@ describe('AmoMultiselectFactory', function() {
expect(result).toEqual({
key: 1,
group: 'B'
})
});
});
});

Expand All @@ -340,7 +340,7 @@ describe('AmoMultiselectFactory', function() {
expect(result).toEqual({
key: 3,
group: 'B'
})
});
});
});
});
Expand Down