2018-01-21 01:45:17 +01:00
|
|
|
// Copyright 2018 Google Inc. Use of this source code is governed by an
|
|
|
|
// MIT-style license that can be found in the LICENSE file or at
|
|
|
|
// https://opensource.org/licenses/MIT.
|
|
|
|
|
|
|
|
@TestOn('node')
|
2018-11-16 00:16:24 +01:00
|
|
|
@Tags(['node'])
|
2018-01-21 01:45:17 +01:00
|
|
|
|
|
|
|
import 'dart:js_util';
|
|
|
|
|
|
|
|
import 'package:test/test.dart';
|
|
|
|
|
|
|
|
import '../api.dart';
|
|
|
|
import 'utils.dart';
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
group("from a parameter", () {
|
2021-03-17 03:25:39 +01:00
|
|
|
late NodeSassNull value;
|
2018-01-21 01:45:17 +01:00
|
|
|
setUp(() {
|
2020-01-17 23:46:10 +01:00
|
|
|
value = parseValue<NodeSassNull>("null");
|
2018-01-21 01:45:17 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
test("is instanceof Null", () {
|
|
|
|
expect(value, isJSInstanceOf(sass.types.Null));
|
|
|
|
});
|
|
|
|
|
|
|
|
test("equals NULL", () {
|
|
|
|
expect(value, equals(sass.types.Null.NULL));
|
|
|
|
});
|
2020-01-17 23:46:10 +01:00
|
|
|
|
|
|
|
test("has a useful .constructor.name", () {
|
|
|
|
expect(value.constructor.name, equals("SassNull"));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
group("from a constant", () {
|
|
|
|
test("has a useful .constructor.name", () {
|
|
|
|
expect(sass.types.Null.NULL.constructor.name, equals("SassNull"));
|
|
|
|
});
|
2018-01-21 01:45:17 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
test("the constructor throws", () {
|
|
|
|
expect(() => callConstructor(sass.types.Null, []), throwsA(anything));
|
|
|
|
});
|
2020-04-25 01:11:46 +02:00
|
|
|
|
|
|
|
test("the convenience accessor sass.NULL exists", () {
|
|
|
|
expect(sass.NULL, equals(sass.types.Null.NULL));
|
|
|
|
});
|
2018-01-21 01:45:17 +01:00
|
|
|
}
|