Skip to content

Commit

Permalink
Merge pull request #45 from mbland/reorganize-frontend-modules
Browse files Browse the repository at this point in the history
Reorganize frontend modules and other files
  • Loading branch information
mbland committed Dec 15, 2023
2 parents a242a64 + 3892b00 commit b44c22c
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig, mergeConfig } from 'vitest/config'
import viteConfig, { buildDir } from './vite.config'
import viteConfig, { buildDir } from '../vite.config'

export default mergeConfig(viteConfig, defineConfig({
test: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig, mergeConfig } from 'vitest/config'
import viteConfig from './vite.config'
import viteConfig from '../vite.config'

export default mergeConfig(viteConfig, defineConfig({
test: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @module init
*/

import Placeholder from './components/placeholder'
import Placeholder from './placeholder'

/**
* Instantiates the top level objects and calls the `init()` method on each.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
import initApp from './init'
import { describe, expect, test } from 'vitest'
import StringCalculatorPage from './test-page'
import StringCalculatorPage from '../test/page'

// @vitest-environment jsdom
describe('initial state after calling initApp', () => {
Expand Down
2 changes: 1 addition & 1 deletion strcalc/src/main/frontend/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* demonstrate how to design much larger applications for testability.
* @module main
*/
import initApp from './init'
import initApp from './components/init'

/**
* Calls the application initializer with the global window and document.
Expand Down
4 changes: 2 additions & 2 deletions strcalc/src/main/frontend/main.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { describe, afterEach, expect, test } from 'vitest'
import { PageLoader } from './test-helpers'
import StringCalculatorPage from './test-page'
import { PageLoader } from './test/helpers'
import StringCalculatorPage from './test/page'

describe('String Calculator UI on initial page load', () => {
const loader = new PageLoader('/strcalc')
Expand Down
2 changes: 1 addition & 1 deletion strcalc/src/main/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"test": "vitest",
"test-run": "vitest run",
"test-ui": "vitest --ui --coverage",
"test-ci": "eslint --color --max-warnings 0 . && vitest run --config vitest.config.ci-jsdom.js && vitest run --config vitest.config.ci-browser.js",
"test-ci": "eslint --color --max-warnings 0 . && vitest run --config ci/vitest.config.js && vitest run --config ci/vitest.config.js",
"coverage": "vitest run --coverage",
"jsdoc": "bin/jsdoc -c ./jsdoc.json ."
},
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import { fragment } from './test-helpers'
import { fragment } from './helpers'

/**
* Represents the StringCalculator web page.
Expand Down
8 changes: 3 additions & 5 deletions strcalc/src/main/frontend/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import handlebarsPrecompiler from './rollup-plugin-handlebars-precompiler.js'
import handlebarsPrecompiler from
'./plugins/rollup-plugin-handlebars-precompiler.js'
import { defineConfig } from 'vite'
import { configDefaults } from 'vitest/config'
import path from 'node:path/posix'
Expand Down Expand Up @@ -36,10 +37,7 @@ export default defineConfig({
reportsDirectory: buildDir('reports/frontend/coverage'),
// Remove 'exclude:' once rollup-plugin-handlebars-precompile moves
// into its own repository.
exclude: [
...configDefaults.coverage.exclude,
'rollup-plugin-handlebars-precompiler.js'
]
exclude: [ ...configDefaults.coverage.exclude, 'plugins/*' ]
},
browser: {
name: 'chrome'
Expand Down

0 comments on commit b44c22c

Please sign in to comment.