<script> tags in templates for Tests script not working

Hi all,
I am trying to create a very simple Tests script, which can display response text. Here my <span> tag works fine, but I don’t get the console log in <script> tag. The console log outside the template works fine, also if I save the template contents as HTML, it prints the <script> tag console log. But it is not working with POSTMAN. Please help in the resolution.

My Tests script contents are as below.

var template = `

<script>console.log(‘test in template’);</script>

<span style=“white-space: pre-line”>{{result}}</span>


var jsonData = JSON.parse(responseBody);

result = jsonData.result

console.log(‘test: in test’);

pm.visualizer.set(template, {

// Pass the response body parsed as JSON as `data`

result: result