Why-cant-i-assign-variables-using-p5-functions-and-variables-before-setup

@paulgoux

this is what i did in gruntfile.js

  connect: {
      server: {
        options: {
          port: 8000,
          base: '.',
        }
      }
    },

    mocha_phantomjs: {
        all: ['test/*.html']
    }
  });

here is the index.html in test folder that is to rendered on headless browser

<html>
<head>
	<meta charset="utf-8">
	<title>TESTS</title>
	<script src="../lib/p5.js"></script>
	<script src="../lib/p5.sound.js"></script>
	<script>
		window.setup = function setup() {};
		new p5();
	</script>
	<script src="./testDeps/mocha.js"></script>
	<script data-main="test.js" src="./testDeps/require.js"></script>
	<link rel="stylesheet" href="./testDeps/mocha.css" />
</head>
<body>
	<div id="mocha"></div>
	<script>
		mocha.setup('bdd');
	</script>
</body>
</html>

dependecies installed for using headless browser id mocha-phantomjs

please see if it enough to know have a idea about the issue!

1 Like