Skip to content

Commit

Permalink
chore(Root): execute only one more server test
Browse files Browse the repository at this point in the history
  • Loading branch information
kikoruiz committed Nov 21, 2023
1 parent 6bde899 commit 2d9830a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 43 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
"packages/*"
],
"scripts": {
"phoenix": "npx @s-ui/mono phoenix && npx -y ultra-runner --raw --recursive prepublishOnly &>/dev/null",
"phoenix": "npx @s-ui/mono phoenix && npx -y ultra-runner --raw --recursive prepublishOnly --build &>/dev/null",
"co": "npx @s-ui/mono commit",
"lint": "sui-lint js && sui-lint sass",
"test": "npm run test:client && npm run test:server",
"test:client:ci": "npm run test:client",
"test:server:ci": "npm run test:server",
"test:client": "npx @s-ui/test browser -P 'packages/**/!(server)/*Spec.js'",
"test:client:watch": "npm run test:client -- --watch",
"test:server": "npx @s-ui/test server -P 'packages/**/server/*Spec.js'",
"test:server": "npx @s-ui/test server -P 'packages/{sui-test-contract,sui-js-compiler}/**/server/*Spec.js'",
"test:server:watch": "npm run test:server -- --watch",
"test:e2e": "node ./packages/sui-studio/test/server/integration/static-server.js ./packages/sui-studio/test/server/integration/sample-studio/public && npx @s-ui/test-e2e --baseUrl=http://localhost:1234",
"pre-commit": "sui-lint js --staged && sui-lint sass --staged",
Expand Down
76 changes: 35 additions & 41 deletions packages/sui-js-compiler/test/server/jsCompilerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,52 +25,46 @@ describe('@s-ui/js-compiler', () => {
await fs.remove(tsConfigPath)
})

it.skip(
'should compile a "src" folder with a JavaScript file and output it to "lib"',
async () => {
const {stdout} = await exec('node ../../index.js', {
it('should compile a "src" folder with a JavaScript file and output it to "lib"', async () => {
const {stdout} = await exec('node ../../index.js', {
cwd
})

const compiledFilenames = await fs.readdir(libPath)

expect(compiledFilenames).to.eql(['example.js', 'example.test.js'])
expect(stdout).to.contain('[sui-js-compiler]')

const compiledFile = await fs.readFile(libFilePath, 'utf-8')

expect(compiledFile).to.contain('react/jsx-runtime')
expect(compiledFile).to.contain('_jsx')
expect(compiledFile).to.contain('_async_to_generator')
expect(compiledFile).to.contain('_ts_decorate')
expect(compiledFile).to.contain('_ts_generator')
}).timeout(DEFAULT_TIMEOUT)

it('should exclude all the files matching the passed patterns when the "ignore" option exists', async () => {
const {stdout} = await exec(
'node ../../index.js --ignore="./src/**.test.js"',
{
cwd
})
}
)

const compiledFilenames = await fs.readdir(libPath)
const compiledFilenames = await fs.readdir(libPath)

expect(compiledFilenames).to.eql(['example.js', 'example.test.js'])
expect(stdout).to.contain('[sui-js-compiler]')
expect(compiledFilenames).to.eql(['example.js'])
expect(stdout).to.contain('[sui-js-compiler]')

const compiledFile = await fs.readFile(libFilePath, 'utf-8')
const compiledFile = await fs.readFile(libFilePath, 'utf-8')

expect(compiledFile).to.contain('react/jsx-runtime')
expect(compiledFile).to.contain('_jsx')
expect(compiledFile).to.contain('_async_to_generator')
expect(compiledFile).to.contain('_ts_decorate')
expect(compiledFile).to.contain('_ts_generator')
}
).timeout(DEFAULT_TIMEOUT)

it.skip(
'should exclude all the files matching the passed patterns when the "ignore" option exists',
async () => {
const {stdout} = await exec(
'node ../../index.js --ignore="./src/**.test.js"',
{
cwd
}
)

const compiledFilenames = await fs.readdir(libPath)

expect(compiledFilenames).to.eql(['example.js'])
expect(stdout).to.contain('[sui-js-compiler]')

const compiledFile = await fs.readFile(libFilePath, 'utf-8')

expect(compiledFile).to.contain('react/jsx-runtime')
expect(compiledFile).to.contain('_jsx')
expect(compiledFile).to.contain('_async_to_generator')
expect(compiledFile).to.contain('_ts_decorate')
expect(compiledFile).to.contain('_ts_generator')
}
).timeout(DEFAULT_TIMEOUT)
expect(compiledFile).to.contain('react/jsx-runtime')
expect(compiledFile).to.contain('_jsx')
expect(compiledFile).to.contain('_async_to_generator')
expect(compiledFile).to.contain('_ts_decorate')
expect(compiledFile).to.contain('_ts_generator')
}).timeout(DEFAULT_TIMEOUT)

it('should compile a "src" folder with a JSX file written in TypeScript and output it to "lib"', async () => {
// GIVEN a "tsconfig.json" definition in the package root directory
Expand Down

0 comments on commit 2d9830a

Please sign in to comment.