Skip to content

Commit

Permalink
Merge pull request #515 from eXist-db/hotfix-mocha
Browse files Browse the repository at this point in the history
Hotfix mocha
  • Loading branch information
joewiz authored Oct 15, 2020
2 parents 1535ca0 + 31de2a2 commit ed1813c
Show file tree
Hide file tree
Showing 29 changed files with 204 additions and 1,510 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ node_modules/
*.xar

.notes

*.code-workspace
28 changes: 18 additions & 10 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ module.exports = class extends Generator {
},
license: this.props.license[0],
scripts: {
test: 'mocha test/mocha/ --recursive --exit'
test: 'mocha test/mocha/ --recursive --exit && mocha test/xqs/*.js'
},
repository: ''
}
Expand Down Expand Up @@ -489,7 +489,7 @@ module.exports = class extends Generator {
// library package only (fixed)
if (this.props.apptype[1] === 'library') {
this.fs.copy(
this.templatePath('tests/xqSuite/**'),
this.templatePath('tests/xqs/**'),
this.destinationPath('content/')
)
}
Expand Down Expand Up @@ -606,8 +606,8 @@ module.exports = class extends Generator {
odd: this.props.odd
})
this.fs.copyTpl(
this.templatePath('tests/xqSuite/test-suite.xql'),
this.destinationPath('modules/test-suite.xql'), {
this.templatePath('tests/xqs/test-suite.xql'),
this.destinationPath('test/xqs/test-suite.xql'), {
apptype: this.props.apptype[0],
short: this.props.short,
defcoll: this.props.defcoll,
Expand All @@ -618,8 +618,8 @@ module.exports = class extends Generator {
title: this.props.title
})
this.fs.copyTpl(
this.templatePath('tests/xqSuite/test-runner.xq'),
this.destinationPath('modules/test-runner.xq'), {
this.templatePath('tests/xqs/test-runner.xq'),
this.destinationPath('test/xqs/test-runner.xq'), {
short: this.props.short,
defcoll: this.props.defcoll,
defuri: this.props.defuri,
Expand Down Expand Up @@ -826,13 +826,21 @@ module.exports = class extends Generator {
// TODO these will need to be adapted for polymer apps
// Mocha
this.fs.copy(
this.templatePath('tests/mocha/app.js'),
this.destinationPath('test/mocha/app.js')
this.templatePath('tests/mocha/app_spec.js'),
this.destinationPath('test/mocha/app_spec.js')
)

this.fs.copyTpl(
this.templatePath('tests/mocha/xqSuite.js'),
this.destinationPath('test/mocha/xqSuite.js'), {
this.templatePath('tests/mocha/rest_spec.js'),
this.destinationPath('test/mocha/rest_spec.js'), {
apptype: this.props.apptype[1],
short: this.props.short,
defcoll: this.props.defcoll
})

this.fs.copyTpl(
this.templatePath('tests/xqs/xqSuite.js'),
this.destinationPath('test/xqs/xqSuite.js'), {
apptype: this.props.apptype[1],
short: this.props.short,
defcoll: this.props.defcoll
Expand Down
3 changes: 2 additions & 1 deletion generators/app/templates/app.xql
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ declare
function app:foo($node as node(), $model as map(*)) {
<p>Dummy templating function.</p>
};
<%_ if (mysec) { %>

declare function app:test($node as node(), $model as map(*)) {
<p>Dummy template output generated by function app:test at {current-dateTime()}. The templating
function was triggered by the class attribute <code>class="app:test"</code>.</p>
};

<%_ if (mysec) { %>
declare function app:if-attribute-set($node as node(), $model as map(*), $attribute as xs:string) {
let $isSet :=
(exists($attribute) and request:get-attribute($attribute))
Expand Down
1 change: 1 addition & 0 deletions generators/app/templates/github/__gitignore__
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ build/
bower_components/
.idea
reports/
*.code-workspace

# =========================
# tei-pub (gulp)
Expand Down
3 changes: 2 additions & 1 deletion generators/app/templates/repo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<license><%- license %></license>
<copyright>true</copyright>
<type><%- apptype %></type>
<target><%- short %></target>
<%_ if (apptype !== 'library') { %><target><%- short %></target>
<% } -%>
<%_ if (pre) { %><prepare><%- prexq %></prepare>
<% } -%>
<%_ if (post) { %><finish><%- postxq %></finish>
Expand Down
8 changes: 4 additions & 4 deletions generators/app/templates/tests/cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"baseUrl": "http://localhost:8080",
"screenshotsFolder": "reports/screenshots",
"videosFolder": "reports/videos",
"fixturesFolder": "tests/cypress/fixtures",
"integrationFolder": "tests/cypress/integration",
"pluginsFile": "tests/cypress/plugins/index.js",
"supportFile": "tests/cypress/support/index.js"
"fixturesFolder": "test/cypress/fixtures",
"integrationFolder": "test/cypress/integration",
"pluginsFile": "test/cypress/plugins/index.js",
"supportFile": "test/cypress/support/index.js"
}
Loading

0 comments on commit ed1813c

Please sign in to comment.