Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('returns a RestElement node', () => {
const node = new RestElement(tokenStack)
inspect(node).isObject()
inspect(node.type).isEql('RestElement')
inspect(node.toJSON(ctx)).isEql({
type: 'RestElement',
argument: {
type: 'Identifier',
name: 'args'
}
})
})
})
it('returns a DebuggerStatement node', () => {
const tokenStack = new TokenStack([
{ 'type': 'keyword', 'value': 'debugger' },
{ 'type': 'indention', 'value': 0 }
])
const node = new DebuggerStatement(tokenStack)
inspect(node).isObject()
inspect(node.type).isEql('DebuggerStatement')
inspect(node.toJSON(ctx)).isEql({
type: 'DebuggerStatement'
})
})
})
it('returns a fs-node item', () => {
const node = new Super(tokenStack)
inspect(node).isObject()
inspect(node.type).isEql('Super')
})
})
it('returns a SpreadElement node', () => {
const node = new SpreadElement(tokenStack)
inspect(node).isObject()
inspect(node.type).isEql('SpreadElement')
inspect(node.toJSON(ctx)).isEql({
type: 'SpreadElement',
argument: {
type: 'Identifier',
name: 'args'
}
})
})
})
it('returns a fs-node item', () => {
const node = new ReturnStatement(tokenStack)
inspect(node).isObject()
inspect(node.type).isEql('ReturnStatement')
inspect(node.toJSON(ctx)).isEql({
type: 'ReturnStatement',
argument: {
type: 'Identifier',
name: 'banana'
}
})
})
})
it('returns a RestElement node', () => {
const node = new RestElement(tokenStack)
inspect(node).isObject()
inspect(node.type).isEql('RestElement')
inspect(node.toJSON(ctx)).isEql({
type: 'RestElement',
argument: {
type: 'Identifier',
name: 'args'
}
})
})
})
it('returns a DebuggerStatement node', () => {
const tokenStack = new TokenStack([
{ 'type': 'keyword', 'value': 'debugger' },
{ 'type': 'indention', 'value': 0 }
])
const node = new DebuggerStatement(tokenStack)
inspect(node).isObject()
inspect(node.type).isEql('DebuggerStatement')
inspect(node.toJSON(ctx)).isEql({
type: 'DebuggerStatement'
})
})
})
it('returns a fs-node item', () => {
const node = new Super(tokenStack)
inspect(node).isObject()
inspect(node.type).isEql('Super')
})
})
it('returns a SpreadElement node', () => {
const node = new SpreadElement(tokenStack)
inspect(node).isObject()
inspect(node.type).isEql('SpreadElement')
inspect(node.toJSON(ctx)).isEql({
type: 'SpreadElement',
argument: {
type: 'Identifier',
name: 'args'
}
})
})
})
it('returns a fs-node item', () => {
const node = new ReturnStatement(tokenStack)
inspect(node).isObject()
inspect(node.type).isEql('ReturnStatement')
inspect(node.toJSON(ctx)).isEql({
type: 'ReturnStatement',
argument: {
type: 'Identifier',
name: 'banana'
}
})
})
})