Skip to content

Commit

Permalink
feat(tests): reactjs tests template component cli
Browse files Browse the repository at this point in the history
  • Loading branch information
Henriquecesp committed Oct 24, 2021
1 parent 521e322 commit 328b020
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/reactjsComponent.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use strict'

const path = require('path')
const helpers = require('yeoman-test')
const assert = require('yeoman-assert')

describe('\n ReactJS 😸', () => {
beforeAll(() => {
return helpers
.run(path.join(__dirname, '../app'))
.withOptions({ path: './Foo' })
.withArguments('Bar')
.withPrompts({ framework: 'reactjsComponent' })
})

it('should create all files from resource Bar in folder Foo', () => {
assert.file([
'./Foo/components/Bar/component.tsx',
'./Foo/components/Bar/index.tsx',
])
})
})
19 changes: 19 additions & 0 deletions tests/reactjsContext.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict'

const path = require('path')
const helpers = require('yeoman-test')
const assert = require('yeoman-assert')

describe('\n ReactJS 😸', () => {
beforeAll(() => {
return helpers
.run(path.join(__dirname, '../app'))
.withOptions({ path: './Foo' })
.withArguments('Bar')
.withPrompts({ framework: 'reactjsContext' })
})

it('should create all files from resource Bar in folder Foo', () => {
assert.file(['./Foo/contexts/BarContext.tsx'])
})
})
19 changes: 19 additions & 0 deletions tests/reactjsHook.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict'

const path = require('path')
const helpers = require('yeoman-test')
const assert = require('yeoman-assert')

describe('\n ReactJS 😸', () => {
beforeAll(() => {
return helpers
.run(path.join(__dirname, '../app'))
.withOptions({ path: './Foo' })
.withArguments('Bar')
.withPrompts({ framework: 'reactjsHook' })
})

it('should create all files from resource Bar in folder Foo', () => {
assert.file(['./Foo/hooks/useBar.tsx'])
})
})
22 changes: 22 additions & 0 deletions tests/reactjsMui.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use strict'

const path = require('path')
const helpers = require('yeoman-test')
const assert = require('yeoman-assert')

describe('\n ReactJS 😸', () => {
beforeAll(() => {
return helpers
.run(path.join(__dirname, '../app'))
.withOptions({ path: './Foo' })
.withArguments('Bar')
.withPrompts({ framework: 'reactjsMui' })
})

it('should create all files from resource Bar in folder Foo', () => {
assert.file([
'./Foo/components/Bar/component.tsx',
'./Foo/components/Bar/index.tsx',
])
})
})
22 changes: 22 additions & 0 deletions tests/reactjsStyled.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use strict'

const path = require('path')
const helpers = require('yeoman-test')
const assert = require('yeoman-assert')

describe('\n ReactJS 😸', () => {
beforeAll(() => {
return helpers
.run(path.join(__dirname, '../app'))
.withOptions({ path: './Foo' })
.withArguments('Bar')
.withPrompts({ framework: 'reactjsStyled' })
})

it('should create all files from resource Bar in folder Foo', () => {
assert.file([
'./Foo/components/Bar/component.tsx',
'./Foo/components/Bar/index.tsx',
])
})
})

0 comments on commit 328b020

Please sign in to comment.