0

so I'm testing a smart contract a js framework called mocha and running the test through truffle.


require('chai')
.use(require('chai-as-promised'))
.should()

contract('Token', (accounts) => {
    
    describe('deployment', () => {
        it('tracks then name', async () => {
            const token = await Token.new()
            const result = await token.name()
            result.should.equal('My Name')
        })
    })
})```

and this what my terminal returned when I tested it

```truffle test
Using network 'development'.


Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.

ReferenceError: [BABEL] /Users/kalebamarante/blockchain-developer-bootcamp3/test/Token.test.js: Unknown option: base.presents. Check out http://babeljs.io/docs/usage/options/ for more information about options.

A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:

Invalid:
  `{ presets: [{option: value}] }`
Valid:
  `{ presets: [['presetName', {option: value}]] }`

For more detailed information on preset configuration, please see https://babeljs.io/docs/en/plugins#pluginpresets-options.
    at Logger.error (/Users/kalebamarante/blockchain-developer-bootcamp3/node_modules/babel-core/lib/transformation/file/logger.js:41:11)
    at OptionManager.mergeOptions (/Users/kalebamarante/blockchain-developer-bootcamp3/node_modules/babel-core/lib/transformation/file/options/option-manager.js:226:20)
    at OptionManager.init (/Users/kalebamarante/blockchain-developer-bootcamp3/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at File.initOptions (/Users/kalebamarante/blockchain-developer-bootcamp3/node_modules/babel-core/lib/transformation/file/index.js:212:65)
    at new File (/Users/kalebamarante/blockchain-developer-bootcamp3/node_modules/babel-core/lib/transformation/file/index.js:135:24)
    at Pipeline.transform (/Users/kalebamarante/blockchain-developer-bootcamp3/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
    at Object.transformFileSync (/Users/kalebamarante/blockchain-developer-bootcamp3/node_modules/babel-core/lib/api/node.js:152:10)
    at compile (/Users/kalebamarante/blockchain-developer-bootcamp3/node_modules/babel-register/lib/node.js:118:20)
    at loader (/Users/kalebamarante/blockchain-developer-bootcamp3/node_modules/babel-register/lib/node.js:144:14)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/kalebamarante/blockchain-developer-bootcamp3/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at /usr/local/lib/node_modules/truffle/node_modules/mocha/lib/mocha.js:384:36
    at Array.forEach (<anonymous>)
    at Mocha.loadFiles (/usr/local/lib/node_modules/truffle/node_modules/mocha/lib/mocha.js:381:14)
    at Mocha.run (/usr/local/lib/node_modules/truffle/node_modules/mocha/lib/mocha.js:954:10)
    at resolve (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/test.js:159:1)
    at new Promise (<anonymous>)
    at Object.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/test.js:158:1)
Truffle v5.1.39 (core: 5.1.39)
Node v10.16.3

what do you suggest I do?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.